4 ms·
Styling <table> still sucks though. I mean for displaying tables, not layout.
by inshadows 5y ago
Styling <table> still sucks though. I mean for displaying tables, not layout.
- runarberg 5y agoAgreed, and to make matters worse if you mess with the display property on any of the table components (<table>, <tbody>, <th>, <tr>, etc.), or position them anything other then static, you loose the accessibility layout. Meaning that you must explicitly set the role (e.g. <tr role="row">, <th role=columnheader>, etc.) or else with assistive technology wont be able to navigate the table intuitively.
- jozzy-james 5y ago> not layout email would like a word.
- ThatMedicIsASpy 5y agomaking tables a css grid is not an option?
- asddubs 5y agonot if it's a really long table, grid fails at 1000ish rows in chrome
- jozzy-james 5y agotbf, if you have a 1000 row table in html - you might have other problems.
- asddubs 5y agoagreed. To be fair in my case it was a 500+-row table that i was trying to split into 2 rows each on small screens. Still arguably way more than reasonable, but this was a situation where it's legacy code and I could only change the html/css. I ended up doing each row as it's own flex, which is slightly annoying since it can't adapt to the contents being displayed, and I had to just stipulate widths for each column, but I guess it's not hard to see why dynamically calculating the widths would be a bit laggy. Firefox handled arbitrarily big grids like a champ though
- asddubs 5y agoi wish they would at least add colspan/rowspan to css. doesn't cost browsers anything to implement, would make responsive tables a lot easier