4 ms·
Have we wrapped all the way around to <table> layouts again?
by N_Lens 11mo ago
Have we wrapped all the way around to <table> layouts again?
- hackthemack 11mo agoI agree. I got really tired of hearing tables are for tabular data! For 20+ years. My reply was always, Who cares if it accomplished the layout you want. If the meaning of a word is what got people so hung up... why not go and make a new css term that did what tables did but improve on it. Now 20+ years later, that is pretty much what they did.
- strixli 11mo agoScreen readers do care. A lot. Grid and subgrid solve the problem without breaking DOM and semantics, which is a huge concern in accessibility.
- sussmannbaka 11mo agoYes and no. <table> layouts were a hack that solved a real problem but came with massive downsides. People didn’t tell you to not use <table> to lay out content because grids are bad (they are quite handy! take a look at Grid Systems by Josef Müller-Brockmann) but because <table> both posed technical and accessibility problems. A layout grid is not a table (or a <table >). A table (with and without <>) comes with attached semantics, hierarchy, reading direction etc. and is extremely rigid, which makes it a bad fit for differing screen sizes. It’s true that this was a blind spot for a long time and that it was frustrating to not be able to efficiently lay out content in 2D when <table> was just there. But it was the wrong choice then as it is now and it has been baseline available for 8 years now. I hope it won’t take another 8 years until the comparison stops :o)
- lelandfe 11mo ago> A layout grid is not a table Ain't it? Rows and columns get you a table.
- dwb 11mo agoA table is for tabulating data. They have quite different meaning and purpose, even if they share a couple of characteristics.
- deleted 11mo ago[deleted]
- deleted 11mo ago[deleted]
- deleted 11mo ago[deleted]
- lelandfe 11mo agoTabulate means to organize by rows and columns. Layout grids organize data by rows and columns.
- dwb 11mo agoYou have just restated the similarity I referred to. The ways they are different make them important enough to distinguish. “Tabulate” doesn’t just mean organising anything by rows and columns, it means organising data for a particular purpose. And layout grids usually end up looking quite different to tables because although they have a broadly similar underlying structure, the purpose is quite different.
- sussmannbaka 11mo agoThey don't! Layout grids are less about the rows and columns and more about the lines separating them (which is why those get a lot of attention in CSS grid). Take a look at how layout grids are used in design and you will quickly find examples that are extremely inconvenient to realize with HTML tables. I'm sure it can be done and I'm sure some poor email marketing dev had to, but the result would be entirely static and not able to reflow.
- pacifika 11mo agoHTML spec couldn’t just have added a grid element?
- system2 11mo agoTry to select a tr / td without pulling your hair.
- halapro 11mo ago<table> was a problem because it described content, not style. There's nothing wrong with creating grids.
- joduplessis 11mo agoWas going to say this too!
- dreamcompiler 11mo agoYes. I built layouts like this with automatic server-rendered tables 25 years ago, and they just worked with very little effort. Tables weren't responsive or accessible or any of the other things we now recognize as essential, but it has certainly taken a long time to reinvent the table wheel. And all the while we've had to listen to people screaming in our ears that tables were bad, while also listening to them argue about which of their incredibly difficult and patently subpar "solutions" we were supposed to use instead.