Quantcast
Viewing all articles
Browse latest Browse all 1315

CSS: create the optical illusion of a column layout using rows

I have a layout that consists of rows that contain columns (they are all divs). I want to create the illusion of a column based table, even though I am using rows.

I want each column in a row to match the corresponding column in another row’s width. So for example, column 2 in row 1 is 300px, therefore column 2 in row 2 is also 300px. But column 1 or 3 could be other widths (but equal to their corresponding column).

The tricky part is that the columns can be different widths depending on content in them, so I can just give them specific widths to start.

Image may be NSFW.
Clik here to view.
enter image description here

Is this possible with CSS grid of flex box? Or does the fact these columns are in separate rows make it impossible without javascript?

EDIT: clarification


Viewing all articles
Browse latest Browse all 1315

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>