Greenguy's Board


Go Back   Greenguy's Board > General Business Knowledge
Register FAQ Calendar Today's Posts

 
 
Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 2008-10-09, 12:11 PM   #3
MadCat
If something's hard to do, then it's not worth doing
 
MadCat's Avatar
 
Join Date: Sep 2008
Location: Berlin, Germany
Posts: 247
Quote:
Originally Posted by Cleo View Post
As someone that still uses tables what is the big deal about still using tables?

I just find tables so much easier to use then containers but then again I haven't really tried to use containers.
The thing with the HTML doctypes is that using tables puts browsers in "Quirks" rendering mode, where you get to deal with all the little differences between IE and Firefox. Using XHTML Strict basically enforces a standards compliant mode of rendering, which makes a site (theoretically still, mind you) look the same across all browsers.

There is also some speculation that sites using xhtml strict get a slightly higher ranking off search engines but I'm still calling bunk on that one.

Anyway, using tables for layout at this point in time is also not in your best interest due to the way tables are often rendered (slowly), and nested tables can seriously hang a browser for a few seconds which means that the surfer might just close the window and go "eh fuck it".

So, say, you have a table layout for galleries, 5 columns, 4 rows for a total of 20 pics. To put that in xhtml strict, first we need some styles:

Code:
#gallery {
  width: 800px;
  margin: 0px;
  padding: 0px;
}

#gallery div.row {
  clear: both;
}

#gallery div.image {
  width: 150px;
  padding: 10px;
  float: left;
  position: relative;
}

#gallery div.image img {
  border: 0;
}

.clear {
  clear: both;
}
And then here's your layout:

Code:
<div id="gallery">
  <div id="row1" class="row">
    <div id="image1" class="image">
      <a href="/image.jpg"><img src="/image_thumb.jpg" /></a>
    </div>
     .
     .
     .
     .
  </div>
  <div id="row2" class="row">
    .
    .
    .
    .
    .
  </div>
</div>
It will come out looking more or less like your average old table layout, but renders fast, and from a size perspective, your page becomes a couple bytes smaller

Caveat: It should look the same as your table layout but I'm doing this from memory so it might not look right

Last edited by MadCat; 2008-10-09 at 12:13 PM.. Reason: eye kin speelz rite!
MadCat is offline   Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:58 PM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc