Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a CSS/HTML property/attribute that can swap a table's rows & columns?

Is there a semantic CSS or HTML property/attribute to show a table with rows & columns swapped?

In other words, I would like to write the code one way, but have something that flips the rows with columns, and vice versa.

Looking around, I only found JavaScript ways to swap them, but in my case — that's not what I'm looking for. (If there isn't a CSS/HTML solution, then I would rather refactor the code.)

like image 807
o0'. Avatar asked Jan 23 '13 15:01

o0'.


1 Answers

Sorry, but no there isn't.

You might be to achieve something close by rotating the whole table by 90 degrees, and then rotating the cells by 90 degrees the opposite direction. You'd probably also need to manually set the height and width of all the elements to make it look sensible.

That would be a major hack, though; I really wouldn't recommend it.

There aren't any other CSS solutions to this; certainly not a "standard" one. It's not exactly a standard thing to want to do.

like image 160
SDC Avatar answered Nov 11 '22 11:11

SDC