Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a business reason for striving for pure CSS layout?

Tags:

css

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).

like image 587
deadprogrammer Avatar asked Aug 07 '08 21:08

deadprogrammer


People also ask

What are three types of layout CSS?

CSS layout types: Fixed, Elastic, and Fluid.

Is CSS used for layout?

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.

How do I get better at CSS layout?

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.


1 Answers

Since this is stackoverflow, I'll give you my programmer's answer

semantics 101

First 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 102

Now 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.

conclusion

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.

like image 131
Carl Camera Avatar answered Sep 21 '22 00:09

Carl Camera