cssflexboxcss-gridprint-css

Is it better to use CSS Grid, Flexbox or Table for a complex printable layout that doesn't break when unresponsive?


How do I make this kind of layout using css? Also, It should be printable as it looks.

I have thought about making this using table but as I have started I am feeling that it'll be extreemly painful to make this using table. Now I'm exploring flexbox and grid but it seems that I am pretty much confused about which one to use.

This design also needs to be unresponsive as breaking the layout will be unreadable. It should print as it looks.

Please take a look at the layout image

I'm a beginner in CSS. Please help. Thank you.


Solution

  • Since this mostly relates to page structure, I'm more leaning towards nested HTML tables. I think you'd be safe using a strictly defined grid as well, but this use case seems to be one of the few where using a table would actually be appropriate.

    Remember, the purpose of an HTML table is to "represent tabular data". I would say you data looks awfully tabular.

    Yes, this will probably be fairly painful to build. But I think that such a complex layout will be painful regardless of which solution you choose. Might as well choose the correct one.