Width of Columns in Responsive Collapse Mode
-
Hi Tobias!
I’ve two almost identical tables that behave differently in responsive mode.
1) In the first table, the first two columns fits on a small screen size. This is how I want both tables to display.
2) However, on the second table, only the first column fits on the same screen size.See this illustration of the issue.
I’ve trying a lot of different CSS selectors, widths, etc., but nothing has worked so far. I might have missed something obvious.
How can I make the second table to display as the first one?
I’m using the same media queries for both tables (besides the table identifier (.tablepress-id-42 or .tablepress-id-43.) This is my CSS for the “misbehaving” table:
/* MEDIA QUERIES */ /* PHONE */ @media screen and (max-width: 768px) and (orientation:portrait) { .dataTables_wrapper { width: 100% !important; /* the wrapper also controls the search input field */ } .tablepress-id-43 { width: 100% !important; /* the data table */ } .tablepress-id-43 .column-1 { max-width:100px; } .tablepress-id-43 .column-3 { max-width:100px; } .tablepress-id-43 .column-4 { max-width:100px; } .none td:first-child { width: 80px } /*.none td:nth-child(2) { padding-right: 0px; }*/ .none td { padding-right: 0px !important; } } @media screen and (max-width: 768px) and (orientation:landscape) { .dataTables_wrapper { width: 100% !important; /* the wrapper also controls the search input field */ } .tablepress-id-43 { width: 100% !important; } .tablepress-id-43 .column-1 { max-width:100px; } .tablepress-id-43 .column-3 { max-width:100px; } .tablepress-id-43 .column-4 { max-width:100px; } .none td:first-child { width: 80px } /*.none td:nth-child(2) { padding-right: 0px; }*/ .none td { padding-right: 0px !important; } } /* TABLET */ @media screen and (max-width: 1025px) { .dataTables_wrapper { width: 100% !important; /* the wrapper also controls the search input field */ } .tablepress-id-43 { width: 100% !important; } .tablepress-id-43 .column-1 { max-width:120px; } .tablepress-id-43 .column-3 { max-width:120px; } .tablepress-id-43 .column-4 { max-width:102px; } .none td:first-child { width: 80px } /*.none td:nth-child(2) { padding-right: 0px; }*/ .none td { padding-right: 0px !important; } } /* DESKTOP */ @media screen and (max-width: 10000px) { .dataTables_wrapper { width: 100% !important; /* the wrapper also controls the search input field */ } .tablepress-id-43 { width: 100% !important; } .none td:first-child { width: 120px } .none td:nth-child(2) { padding-right: 50vw; } .dtr-details .none { max-width: 600px !important; } }
The page I need help with: [log in to see the link]
- The topic ‘Width of Columns in Responsive Collapse Mode’ is closed to new replies.