Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Tables are not responsive

Started by Muut Archive 10 years ago · 4 replies · 461 views
10 years ago

Latest version of Grav on antimatter:

I just inserted a 22 column x 5 row table into a default page and it looks great on a 1920px wide monitor. However, the table does not collapse when I pinch the window to a smaller size -- colums are simply cut off and you can't scroll to view them.

Is there a fix for this? I used the following markup for the table:

| Col 01 | Col 02 | Col 03 | ---> to 22 columns
| :----- | :----- | :----- | ---> etc.

10 years ago

It would be nice if the markdown actually created divs using display:table, display:table-cell instead of actual table html code. Not sure if that is something the developers have any control over and there may still be instances where tabular data would be better in a table.

As chidvanid pointed out, there are examples for responsive tables using straight css. There are also open source scripts like tablesaw you can use in the site but usually they require adding classes to your table.

In some instances I have read of people designing the table for mobile and then writing css to make it look right on desktop. Never tried it myself and with a media query and some css you can usually make a table look ok in responsive layouts.

I still prefer using divs when possilbe. You can always create the table and copy the source into a tool like http://divtable.com/converter/ and convert it to dvis. Than create a simple media query to make it responsive.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1366 9 years ago
Archive · by Muut Archive, 9 years ago
2 940 9 years ago
Archive · by Muut Archive, 9 years ago
2 4069 9 years ago
Archive · by Muut Archive, 9 years ago
1 2960 9 years ago
Archive · by Muut Archive, 9 years ago
3 1125 9 years ago