3 ms·
I doubt you understand what the word "semantically" means. I don't see how polluting markup with <table> (and tables were often nested), <tr> and <td> is any b
by rimantas 11y ago
I doubt you understand what the word "semantically" means.
I don't see how polluting markup with <table> (and tables were often nested), <tr> and <td> is any better, not to mention that often already existing markup was sufficient and no extra was needed.
Also, div's by definition have no semantic meaning, and that's a good thing—those who bothered to care know that tables for layout had their share of accessibility issues.
Alas, now when most race to stuff as much anuglar bootstraps ino their SPA nobody cares about semantics and accessibility any more.
- Udik 11y agoI think he's right. The syntax says "display this stuff as a table and a table cell", but what in fact we mean is "center this thing". The fact that both "style as a table" and "center" attain to the visual aspect doesn't change the fact there is a semantic difference between the two. Also, if divs have no semantic meaning in the context of the document's structure, it means they serve some other purpose: and that purpose is visual styling (not directly but through a css applied to them). How is this not a violation of the separation between document structure and presentation?
- extra88 11y agoThere can be reasons for grouping a set of elements in the DOM with a parent div besides styling. But sure, it's a "violation" but web standards do not say "you must only use elements that are essential to the semantic structure of the document." I'd say the guideline is "start with semantic elements, add others as needed for styling, programmatic access, componentization, etc."
- olavk 11y agoIt is in principle a violation of the separation between structure and presentation, but it is not a violation of the semantics of HTML which is a bigger issue. Since div's are semantically neutral in HTML, a multitude of "presentational divs" will not confuse screen readers and so on, as the use of <table>-elements will. That said, separation between structure and presentation is desirable, and the necessity to use multiple divs to achieve a layout effect means CSS 2 is not as powerful as we could want. The grid model in CSS 3 is much more powerful, and allows things like separating the presentation order from the structural order.