View Full Version : Do you use <div> or <table>
10-03-2003, 12:21 PM
I have made several post stating my personal preference for page Coding.
My style being, laying out your page with <div class=””></div> TAGS with their placement and style properties defined in exterior CSS. This way your main body of text can be placed directly under the <BODY> TAG.
I have seen many sites posted here designed using tables. My problem with tables is how spaced the content is with all the <tr><td> TAGS and the main text content ending up way at the bottom of your Code.
Which style do you use and why?
10-03-2003, 12:32 PM
My problem with tables is how spaced the content is with all the <tr><td> TAGS and the main text content ending up way at the bottom of your Code.
Hmmmm spaced? You have tried <TABLE cellpadding="0" cellspacing="0">?? cellspacing is the space between each cell and cellpadding is the space between the cells edge and it's content. Give me an example page of "spaced".
10-03-2003, 01:26 PM
I was referring to the amount of code and the relative distance your “main text” is from your BODY TAG.
I looked at your site and I will say the paragraph starting with “The new YMSG login has been cracked. Now both Trillian and GAIM,” Would be the “main text” as it is the first real paragraph.
And yes you use tables to layout your site. But the “main text” is 173 lines below your BODY TAG.
If your site was laid out with <div> TAGS, this text could be your first line below your BODY TAG.
<div class=”main_text”> The new YMSG login has been cracked. Now both Trillian and GAIM,…..</div>
Then you could go on to add
<div class=”title”>This is the title</div>
<div class=”menu”>add your button setup</div>
My thought is concerning the amount of code search engines have to read to find relative text to your Meta tags. I have heard they only read “so far” and if they don’t find relative text they will move on and your placement in their listings will be poor.
10-03-2003, 09:23 PM
I'm assuming that you're talking about page layout rather than the information that tables are meant for, tabular information.
If you have your pages set up to meet w3c secifications, then you should never use tables for your page layout. Yes, I used to do that, but that was before I learned about the HTML specifications and CSS. With CSS you can separate your style information from the content, leaving a very clean HTML file. So much extraneous information is removed and the CSS file only has to be downloaded for the first page of your site. File size and download time is reduced. The "tag soup" is eliminated making it easier for the search engines to catalog your site. You can have valid HTML, and meet accessibility requirements, opening up your site to those with visual problems, motor-skill disablities, etc.
Using tables to format your page is sort of like using Microsoft Excel (or spreadsheet program of your choice) to write letters or make a resume. Sure it will work, but it's not the right tool for the job.