table vs. divs - confusion
- Started
- Last post
- 17 Responses
- alicetheblue
I have been taking a few Lynda.com tuts
and doing some reading on CSS.Some use tables - some use divs.
Do you use divs. Or does it depend on content.thanks.
dazed and confused,
alice;)
- instrmntl0
use divs
- digdre0
tables are 2002
- discoduro0
- Is this a good book? Why is the PDF the same price as the printed book!Josev
- amazon is cheaper
CDN$ 18.87alicetheblue - Yeah it's good. Shows how to create CSS table-based layouts without tables. And capitalism.discoduro
- Basicly how to treat divs as table elements.discoduro
- boobs0
tables are 1998
- alicetheblue0
use divs.
thought so - (every tut does things different -makin' me crazy)- Are all of the tutorials current?Josev
- one that uses tables is 2009!!!alicetheblue
- alicetheblue0
doing XHTML and HTML Essential Training (with CSS)
date released is 7/28/2009.
uses tables in CSS style sheetarghhhhhh
- not data -
so I should replace tables
with divsalicetheblue - Yes, you should replace your <td> with <div>spylon
- not data -
- ukit0
It depends on the content. Tables are meant for - well, when you have something in a tabular format like a grid list of items. Nothing inherently wrong with them, although people used to use them for page layouts (and truly mass audience sites like Google still do).
Actually, it's better to use more specialized tags when possible and not divs because they are more descriptive. For instance, I use a <ul><li> combo for any kind of navigation or set of items that isn't tabular. HTML 5 will also introduce header tag, footer tag etc .
- ETM0
If you're learning, learn what's current. CSS divs for layout. But as mentioned above, don't be afraid to include a table for what it was designed for, containing tabular data. I don't get it when I see tutorials on how to mimic a table using a bunch of divs to contain tabular data.
- I agree - current.
you'd think that the above mentioned tut 2009 would be currentalicetheblue - < correct.juhls
- hello ottawa!!!alicetheblue
- I agree - current.
- lukus_W0
A long time ago, the web was full of blinking text, in-construction animated gifs and simple hyperlinked pages. CSS didn't exist (or at least wasn't well supported) and web pages were very very basic.
Once the web started to become commercial, more advanced and slick looking layouts were required. The problem was, there wasn't a decent way of achieving this as browser technology was still in it's infancy. So, to achieve what was required, a lot of web designer's decided to think laterally, and (mis)use the '<table>' element to achieve a decent way of laying out content.
This provided a good temporary fix for many years, but then CSS2 started to gain ground and better ways of styling a page emerged.
There are many, many reasons for not using tables. Probably most important (to those who make sites for money) is the likelihood that you'll be seen as an amateur if you do.
* Use tables when you have tabular content to display.
* If you need to lay things out use divs + css.http://www.opera.com/company/edu… is a good link for learning the basics.
- thanks! bookmarked that from you in another post - now going to read:)alicetheblue
- vaxorcist0
Ideally, you go semantic, with lists, rather than div-o-rama....
but if you have a CSS zealot boss, you use divs all the way, and end up with hundreds of them inside each other, use notepad++ or cssedit to find the start/end, otherwise insanity may happen.....
And... the old 1999 PSD->Slices->Tables can be done very fast for email newsletters, as many email clients read HTML as if it was 1999
- yes, all block-level and inline elements are fair game. avoid tag-souplukus_W
- lukus_W0
Check out firebug and webdev toolbar for firefox. They'll make your life x1000 easier.
- Just started using firebug.great!
Will look into 'webdev"
thanksalicetheblue - https://addons.mozil…lukus_W
- ctrl-shift-f will become your best friendlukus_W
- Just started using firebug.great!
- ukit0
Above all, think carefully about how you are writing your CSS and don't escapsulate ten million divs inside each other, it's just as bad as tables.
I like to see how few elements I can use to make a layout work, and use traditional descriptive elements like <p>, <h1> etc tags as much as possible. Imagine someone was viewing your page without any styling, would it still have some kind of structure or no?
- would I first do it in HTML
for structure - then add CSS for styling?alicetheblue
- would I first do it in HTML
- airey0
tables for tabular data are easier.
- alicetheblue0
reading Google Books: Beginning CSS Web Development
-it's so clear ;-)
- airey0
i stumbled on an SEO marketing company that banged on about improving and knowing everything, their site was just massive jpeg image maps and a crap load of meta tags that aren't used anymore. hahaha.
- SEO has more cowboys than any other aspect of web dev
ckentish - there's some real clowns offering the world it seems.airey
- clowns scare me :(alicetheblue
- SEO has more cowboys than any other aspect of web dev