-
Notifications
You must be signed in to change notification settings - Fork 718
[css-tables] Transposing table contents #8529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Flex has |
It's worth noting that table layout is substantially less symmetric than grid and flex layout (which were designed to work the same way in both axes). Maybe that's not really an issue for this, though. |
Right, I don't think the layout symmetry is the important part here; transposing and then laying out as if it had been the transpose all along seems to be exactly what's desired here. There are some corner cases that'll interact with this, tho, notably the collision mechanics around row/colspans. I presume, tho, that this could be resolved by "just" saying to swap the row/column-major-ness of the algo? That is, find the row/col positions of each cell normally, then transpose them, and layout accordingly? I dunno if this can produce "impossible" layouts, or if that's even something to worry about. |
With the following markup:
... we get something like this: (table: black, thead/tbody: blue, tr: green, td: red): |
|
(I probably should have put the |
Agreed on these counts. Assign each cell to an area per normal, then transpose the areas. Inheritance (and the fake column "inheritance" still work normally per standard DOM relationships; you'll just need to swap which one is setting width and which is setting height, as you did in your examples. |
There should be a way to make the rows and columns transposed, possibly as an extra keyword on the
table-layout
property, or a new CSS property.If you have a very long form where you are modifying multiple objects, e.g. editing multiple Persons with shortName, longName, age, gender, address, etc, it is much easier to generate HTML going by column, instead of looping through all objects per row.
Currently one way to do that is to use
writing-mode: vertical-lr
on the table and thenwriting-mode: horizontal-tb
on the td and th. That works on Google Chrome, but causes each table row to become 0px tall on Firefox.The text was updated successfully, but these errors were encountered: