4 ms·
I gotten off the frontend train ten years ago. Then just the other day I decided that generating some stuff for printing in HTML should be way easier than fussi
by aasasd 5y ago
I gotten off the frontend train ten years ago. Then just the other day I decided that generating some stuff for printing in HTML should be way easier than fussing around with spreadsheets (and was right)—so finally looked up how one positions things with the flexbox. Where back in the day things were like literal masochism and still even selling your soul wouldn't get you far, now it's just ‘put these properties on your divs to tell the browser which way each of them goes’. Whoa daddy.
- bruce511 5y agoSo these days there are 3 layout choices. Table, Flexbox and Grid. The one you pick is ultimately determined by how you want it to work relative to screen size. Table is still good for making tables, that won't change layout based on screen or printer size. Very useful. For a spreadsheet type view, with strict columns and rows, regardless of screen, this might be a good option. Grid is the best alternative where the grid must adapt to screen size, but there are still clear rows and columns in the layout. Flex is more 1D than 2D, but can (easily) be coerced into 2D. It's great for things that should "flow" to fill the page. So now instead of 1 (almost always bad) option, we have 3 distinct options, but it does take some experience to figure out when to use one, and when the other. I recommend the guides at css-tricks for quick reference - I have them on speed dial.