It seems like every time I try to create a pure CSS layout it takes me much longer than if I'd use a table or two. Getting three columns to be equal lengths with different amounts of data seems to require particular fancy hacks, especially when dealing with cross-browser issues.
My Question:
Who are these few tables going to hurt?
Tables seem to work particularly well on tabular data — why are they so reviled in this day and age?
Google.com has a table in its source code, so do many other sites (stackoverflow.com does not by the way).
CSS layout types: Fixed, Elastic, and Fluid.
CSS Grid Layout is a two-dimensional layout system for the web. It lets you lay content out in rows and columns, and has many features that make building complex layouts straightforward.
In CSS, first read the theory on what CSS is, how it works in the browser, and its basic syntax and usage. Learn about the different kinds of stylesheets available, their differences, selectors, and basic styling such as font-size , width , height etc. You can get started by going through the tutorials at MDN.
Since this is stackoverflow, I'll give you my programmer's answer
semantics 101First take a look at this code and think about what's wrong here...
class car { int wheels = 4; string engine; } car mybike = new car(); mybike.wheels = 2; mybike.engine = null;
The problem, of course, is that a bike is not a car. The car class is an inappropriate class for the bike instance. The code is error-free, but is semantically incorrect. It reflects poorly on the programmer.
semantics 102Now apply this to document markup. If your document needs to present tabular data, then the appropriate tag would be <table>
. If you place navigation into a table however, then you're misusing the intended purpose of the <table>
element. In the second case, you're not presenting tabular data -- you're (mis)using the <table>
element to achieve a presentational goal.
Whom does this hurt? No one. Who benefits if you use semantic markup? You -- and your professional reputation. Now go and do the right thing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With