Vertical table on a web page

I want to switch between vertical and horizontal table layout for the same data.

It can be done, though, by applying the same CSS for the first column for a vertical layout as the CSS for the header row for a horizontal layout.

Is there a way to render the web page the way we like (horizontal / vertical).

PS I couldn't add images. Sorry for that.

0


source to share


1 answer


Do you want you to switch rows and columns efficiently?

You cannot do it with tables because A). rows and columns have specific semantics and B). how it is structured in HTML markup group cells in rowsets rather than tablesets with indexes to which you could apply a matrix. Obviously JS can do this if you really should.



If you have a single row of cells, you can organize a similar effect using float <div> tags with a container <div> that changes width (among other methods)

+1


source







All Articles