3 ms·
From the article: > This is why table-based layout fell out of favor. No. No. No. No it is not. Table-based layout didn't fall out of favor because table cel
by smacktoward 15y ago
From the article:
> This is why table-based layout fell out of favor.
No. No. No. No it is not.
Table-based layout didn't fall out of favor because table cells didn't include enough semantic layout information. It fell out of favor because tables are for tabular data, not layout, and layouts that used them therefore created negative consequences in all kinds of situations where the UA expected a table to actually be a table, such as when accessed by a vision-impaired person using a screen reader.
From this perspective a layout using DIVs is always better than a table-based layout, even if the classes and IDs of the DIVs are named presentationally rather than semantically, because DIVs at least are neutral -- they don't carry the weight of a bunch of semantics that are irrelevant or at cross-purposes to what you're trying to achieve.
You are correct that a DIV that's named "left-column" is marginally better than a DIV that's named "span4", if only because of the additional semantic information included in the "left-column" name. But either DIV is far, far better than any table-based layout.
- compay 15y agoPerhaps we were unclear. Coding layouts in tables is coding towards appearance rather than meaning, hence the problems you described.
- smacktoward 15y agoNo, you weren't unclear, you just completely missed my point. Coding layouts in tables is more than just "coding towards appearance." It is misusing a non-appearance-related element, which is worse. The problems I described don't come from "coding towards appearance," and they aren't encountered with DIVs named presentationally rather than semantically. You only get them with tables, because you're abusing the table element by using it in ways that are completely orthogonal to its purpose. I'm not disagreeing that semantically-named DIVs are better than presentationally-named DIVs. What I'm saying is that presentationally-named DIVs are not equivalent to table-based layouts. Table-based layouts are worse than ANY DIV-based layout, regardless of how the DIVs are named.