divs vs tables

The geek forum. PHP, Perl, HTML, hardware questions etc.. it's all in here. Got a techie question? We'll sort you out. Ask your questions or post a link to your own site here!

divs vs tables

Postby glitch1501 » Mon Apr 12, 2004 3:35 am

in designing a website, what do you prefer, divs and css or tables and css, my brother is annoying me saying "divs are the way of the future" and "tables were never meant for anything except tabular data" and its really annoying, so what do you think?

Glitch's Photostream


He wants them to learn to walk and must therefore take away His hand; and if only the will to walk is really there, He is pleased even with their stumbles.

Image

Healing hands of God have mercy on our unclean souls
once again. Jesus Christ, Light of the World, burning
bright within our hearts forever. Freedom means love
without condition, without beginning or an end. Here's
my heart, let it be forever Yours, only You can make
every new day seem so new.
Every New Day - On Distant Shores - Five Iron Frenzy

Nail pierced hands they run with blood
A splitting brow forced by the thorns
His face is writhing with the pain yet it's comforting to me
Passion - Kutless
:thumb:
Image
User avatar
glitch1501
 
Posts: 2177
Joined: Mon Oct 20, 2003 6:50 pm
Location: the debris section

Postby Debitt » Mon Apr 12, 2004 7:40 am

Tables all the way. Divs are nice when you have a more complicated layout, but I've had experiences where they're moved on me and such, so I usually try to stick with tables. ^.~ There ae some tricks you can use to make tables just as effective as div layers, you know.
Image

[SIZE="5"](*゚∀゚)アハア八アッ八ッノヽ~☆[/SIZE]
[SIZE="1"]DEBS: Fan of that manga where the kid's head is on fire.[/SIZE]
User avatar
Debitt
 
Posts: 3654
Joined: Sun Feb 01, 2004 10:00 am
Location: 並盛中学校

Postby Fsiphskilm » Mon Apr 12, 2004 12:45 pm

Table of course
Last edited by Fsiphskilm on Sat Jan 14, 2017 10:53 pm, edited 1 time in total.
I'm leaving CAA perminantly. i've wanted to do this for a long time but I've never gathered the courage to let go.
User avatar
Fsiphskilm
 
Posts: 3853
Joined: Mon Nov 03, 2003 12:00 pm
Location: USA

Postby glitch1501 » Mon Apr 12, 2004 2:22 pm

i will also start to learn more about divs, but im not going to stop using tables like he suggests

Glitch's Photostream


He wants them to learn to walk and must therefore take away His hand; and if only the will to walk is really there, He is pleased even with their stumbles.

Image

Healing hands of God have mercy on our unclean souls
once again. Jesus Christ, Light of the World, burning
bright within our hearts forever. Freedom means love
without condition, without beginning or an end. Here's
my heart, let it be forever Yours, only You can make
every new day seem so new.
Every New Day - On Distant Shores - Five Iron Frenzy

Nail pierced hands they run with blood
A splitting brow forced by the thorns
His face is writhing with the pain yet it's comforting to me
Passion - Kutless
:thumb:
Image
User avatar
glitch1501
 
Posts: 2177
Joined: Mon Oct 20, 2003 6:50 pm
Location: the debris section

Postby Mithrandir » Mon Apr 12, 2004 3:24 pm

I use tables all the time. In my opinion, if it's more complicated than a table to can do with it, you shouldn't be using the web to do it... :lol: Then again, I do all my HTML coding by hand, so it's probably just left over from when I first started using HTML back in... Oh sweet mercy! I've been doing HTML for an entire decade. That's depressing...
User avatar
Mithrandir
 
Posts: 11071
Joined: Fri Jun 27, 2003 12:00 pm
Location: You will be baked. And then there will be cake.

Postby Zedian » Mon Apr 12, 2004 3:46 pm

I go with tables...my knowledge of divs is sadly kind of thin. I can do tables like there is no tommorrow and make them bend, obtuse, acute, horizontal, vertical but when it comes to divs I don't know a thing. I am not use to Flash programming either; just basic hard coding of html.

Just a question and I wanna really know, in what case would you use divs ?
User avatar
Zedian
 
Posts: 839
Joined: Sun Mar 28, 2004 8:01 pm
Location: Somewhere totally simple now

Postby inkhana » Mon Apr 12, 2004 3:58 pm

Hmm...the way I look at it, there are situations where it's advantageous to use one or the other, so I don't really prefer one too much. Divs can be used for some awfully cool stuff...


BOOSTER: Hey, No.1! Where's my cake?!
SNIFIT 1: Booster, Sir! There's a 70% chance the object you're standing on is a cake.
BOOSTER: What? THIS thing's a cake?

You have the power to say anything you want, so why not say something positive?
- Frank Capra

(in response to an interview question "Do you have a pet peeve having to do with this biz?")
People who write below their abilities in order to crank out tons of books and make a buck. Especially Christian authors who do that. Outsiders judge us for it, and make fun of us for it, and it makes Jesus look bad. We of all artists on earth should be the most concerned with doing our best possible work at all times. We of all people should write with all our hearts, as if writing for the Lord and not for men.
- Athol Dickson


Avatar by scarlethibiscus from LJ.
User avatar
inkhana
 
Posts: 3670
Joined: Fri May 30, 2003 10:00 am
Location: meh.

Postby Straylight » Mon Apr 12, 2004 4:11 pm

<div> tags for layout, <tables> for display tabular data, is the general rule. I just totally used tables for this site though. However that could change soon.. I found a very nice table-less skin over at http://www.skelm.com, which i might hack up and use instead...

<div> tags have a number of advantages anyway. They integrate a lot better into CSS, which allows you place ALL your property definitions (including width/height) in a seperate file. For a large site this can cut down on bandwidth a lot, especially for lots of generated dynamic content - the user only has to download that one CSS file, and each page thereafter will be significantly smaller, because all the repeated stuff comes out the CSS file. As an example I compared a vBulletin page using the default vB skin (tables) with one that uses no tables and all <div> tags. The <table> page was about 50k in size, whilst the <div> page was only 15k. (plus the one-off CSS file download)

Tables are also a lot more bulky codewise -- once again using div tags will cut down on bandwidth use.

This is all good news for big sites that use lots of dynamic generated pages (eg this one)

I only recently converted to CSS though.
[align=center]
Image
Banner above created using my avatar generator tool.
You know you want try it.
User avatar
Straylight
 
Posts: 2346
Joined: Mon May 26, 2003 12:00 pm
Location: Manchester, UK

Postby glitch1501 » Mon Apr 12, 2004 4:23 pm

i have made a design using divs instead of tables, there is no content on this site yet

heres the link
http://s88333473.onlinehome.us/stuff/newsite/index.htm



straylight, im kinda to lazy to check, does this site use divs?

Glitch's Photostream


He wants them to learn to walk and must therefore take away His hand; and if only the will to walk is really there, He is pleased even with their stumbles.

Image

Healing hands of God have mercy on our unclean souls
once again. Jesus Christ, Light of the World, burning
bright within our hearts forever. Freedom means love
without condition, without beginning or an end. Here's
my heart, let it be forever Yours, only You can make
every new day seem so new.
Every New Day - On Distant Shores - Five Iron Frenzy

Nail pierced hands they run with blood
A splitting brow forced by the thorns
His face is writhing with the pain yet it's comforting to me
Passion - Kutless
:thumb:
Image
User avatar
glitch1501
 
Posts: 2177
Joined: Mon Oct 20, 2003 6:50 pm
Location: the debris section

Postby Straylight » Mon Apr 12, 2004 4:33 pm

CAA uses some <div> tags to grab stuff out the CSS in the header, but doesn't rely on them completely. I'm more on about using pure CSS with dynamic content anyway. Here's an example:

Check out the source code for these two pages:

http://www.christiananime.net/calendar.php?

http://www.skelm.com/forum/calendar.php?

Both of these pages are generated by the same version of vBulletin (forum software).

Notice how the CAA calender source code is a serious case of blah blah blah with regard to table definations. It's also quite a big file to download.

If you check the source code for the other site (skelm), you'll see how the source code for that page is many many times shorter than CAA source code. It also looks really clean! That's because all the property definitions are specified in seperate file, which needs to be downloaded only once.

I really want to learn CSS, because it's a great way of making dynamic pages really efficient...

EDIT: BTW the calender page on the other site doesn't work in IE properly. He'll probably switch it round at some point so that it does.
[align=center]
Image
Banner above created using my avatar generator tool.
You know you want try it.
User avatar
Straylight
 
Posts: 2346
Joined: Mon May 26, 2003 12:00 pm
Location: Manchester, UK

Postby glitch1501 » Mon Apr 12, 2004 6:26 pm

wow, i didnt know we had a calender here, lol

Glitch's Photostream


He wants them to learn to walk and must therefore take away His hand; and if only the will to walk is really there, He is pleased even with their stumbles.

Image

Healing hands of God have mercy on our unclean souls
once again. Jesus Christ, Light of the World, burning
bright within our hearts forever. Freedom means love
without condition, without beginning or an end. Here's
my heart, let it be forever Yours, only You can make
every new day seem so new.
Every New Day - On Distant Shores - Five Iron Frenzy

Nail pierced hands they run with blood
A splitting brow forced by the thorns
His face is writhing with the pain yet it's comforting to me
Passion - Kutless
:thumb:
Image
User avatar
glitch1501
 
Posts: 2177
Joined: Mon Oct 20, 2003 6:50 pm
Location: the debris section

Postby Zedian » Tue Apr 13, 2004 5:28 am

Straylight your right, that second website's code certainly looks a LOT cleaner then the first one. The first site was a long trip down...the second one the variables were declared -- line after line everything displayed was shown pretty smooth.

Just a question, probably not related to the topic. I've never worked with VB forums, is the code generated as each object is created like the Visual Basic.NET programming language or must you laboriously make each line ?
User avatar
Zedian
 
Posts: 839
Joined: Sun Mar 28, 2004 8:01 pm
Location: Somewhere totally simple now

Postby shooraijin » Tue Apr 13, 2004 7:37 am

My main problem with <divs> is that CSS support is b0rken in some browser versions which are widely in use (Netscape 4.7-4.8, for one), and the level of support for certain features between Mozilla and IE browsers is still unequal.

Tables, on the other hand, "just work."
"you're a doctor.... and 27 years.... so...doctor + 27 years = HATORI SOHMA" - RoyalWing, when I was 27
"Al hail the forum editting Shooby! His vibes are law!" - Osaka-chan

I could still be champ, but I'd feel bad taking it away from one of the younger guys. - George Foreman
User avatar
shooraijin
 
Posts: 9927
Joined: Thu Jun 26, 2003 12:00 pm
Location: Southern California

Postby Debitt » Tue Apr 13, 2004 8:04 am

shooraijin wrote:My main problem with <divs> is that CSS support is b0rken in some browser versions which are widely in use (Netscape 4.7-4.8, for one), and the level of support for certain features between Mozilla and IE browsers is still unequal.

Tables, on the other hand, "just work."

=/ that's the exact problem I have with divs. CSS is fun, and it works well, but things can get really screwy in netscape (all the pretty link filters go byebye)

Oh yeah, and before I forget, nice layout you have there glitch! ^^ It's really clean and stylinsh. xD
Image

[SIZE="5"](*゚∀゚)アハア八アッ八ッノヽ~☆[/SIZE]
[SIZE="1"]DEBS: Fan of that manga where the kid's head is on fire.[/SIZE]
User avatar
Debitt
 
Posts: 3654
Joined: Sun Feb 01, 2004 10:00 am
Location: 並盛中学校

Postby Straylight » Tue Apr 13, 2004 11:41 am

Zedian wrote:Straylight your right, that second website's code certainly looks a LOT cleaner then the first one. The first site was a long trip down...the second one the variables were declared -- line after line everything displayed was shown pretty smooth.

Just a question, probably not related to the topic. I've never worked with VB forums, is the code generated as each object is created like the Visual Basic.NET programming language or must you laboriously make each line ?


vB stands for vBulletin and has nothing to do with visual basic -- it's a forum system based around PHP and MySQL. The PHP generates the pages by pulling info from a MySQL database. If you were using a M$ system you'd probably wind up using ASP. :)

Shoo is right though, a lot of browsers have serious problems with <div> tags and purer forms of CSS, which is a real shame. IE one of the major culprits. However, there are workarounds for webdevelopers. This project looks extremely promising (attempts to fix IE related CSS issues):

http://dean.edwards.name/IE7/intro/

As far as Netscape goes, I'm really not sure whether it's worth trying to support an obselete version (4.8). The latest version of Netscape is 7.1 and is based around Mozilla's gecko engine. It's IMO that people using netscape 4.8 need to upgrade their browser.

Regardless of these problems, I'm pretty sure that CSS will be the future of webdesign -- it's far more efficient, and is based around a really nice tidy object model.
[align=center]
Image
Banner above created using my avatar generator tool.
You know you want try it.
User avatar
Straylight
 
Posts: 2346
Joined: Mon May 26, 2003 12:00 pm
Location: Manchester, UK

Postby Mithrandir » Tue Apr 13, 2004 1:37 pm

Some people with old hardware can't readily upgrade to "the new thing" whatever it may be. On the other hand, tables still work. And I can do the site the "pretty way" you saw using tables too - probably a lot easier than it was done with divs, IMO.

It's a question of what one if familiar with...
User avatar
Mithrandir
 
Posts: 11071
Joined: Fri Jun 27, 2003 12:00 pm
Location: You will be baked. And then there will be cake.

Postby glitch1501 » Tue Apr 13, 2004 2:00 pm

that was one of my arguements to him(some browsers dont support it as well as ie)

Glitch's Photostream


He wants them to learn to walk and must therefore take away His hand; and if only the will to walk is really there, He is pleased even with their stumbles.

Image

Healing hands of God have mercy on our unclean souls
once again. Jesus Christ, Light of the World, burning
bright within our hearts forever. Freedom means love
without condition, without beginning or an end. Here's
my heart, let it be forever Yours, only You can make
every new day seem so new.
Every New Day - On Distant Shores - Five Iron Frenzy

Nail pierced hands they run with blood
A splitting brow forced by the thorns
His face is writhing with the pain yet it's comforting to me
Passion - Kutless
:thumb:
Image
User avatar
glitch1501
 
Posts: 2177
Joined: Mon Oct 20, 2003 6:50 pm
Location: the debris section

Postby Straylight » Tue Apr 13, 2004 4:58 pm

Hmm, I wonder if you can hybridise. Perhaps it's possible to use tables instead and define every attribute of the table tags through CSS...

That way things would display better on older browsers, even if some of the fancy design stuff doesn't appear. The bandwidth advantage would probably stick too.

Guess I need to learn some more CSS..
[align=center]
Image
Banner above created using my avatar generator tool.
You know you want try it.
User avatar
Straylight
 
Posts: 2346
Joined: Mon May 26, 2003 12:00 pm
Location: Manchester, UK

Postby Fsiphskilm » Tue Apr 13, 2004 8:50 pm

Yea... I've been u go.
Last edited by Fsiphskilm on Sat Jan 14, 2017 10:54 pm, edited 1 time in total.
I'm leaving CAA perminantly. i've wanted to do this for a long time but I've never gathered the courage to let go.
User avatar
Fsiphskilm
 
Posts: 3853
Joined: Mon Nov 03, 2003 12:00 pm
Location: USA

Postby Mithrandir » Wed Apr 14, 2004 8:23 am

o.O

Hard? Ri..........ght....

Anyway, SL... I was under the impression that the tables you are using on CAA ARE defined in CSS... The sheet is included on the pages dynamically, as the are coming out of PHP, but it's deffinately there. That's how you get those elegant class definitions for the thin black line. Which I stole for my PHP based admin screen...
You do not have the required permissions to view the files attached to this post.
User avatar
Mithrandir
 
Posts: 11071
Joined: Fri Jun 27, 2003 12:00 pm
Location: You will be baked. And then there will be cake.

Postby Straylight » Wed Apr 14, 2004 4:33 pm

Anyway, SL... I was under the impression that the tables you are using on CAA ARE defined in CSS... The sheet is included on the pages dynamically, as the are coming out of PHP, but it's deffinately there. That's how you get those elegant class definitions for the thin black line. Which I stole for my PHP based admin screen...


Yup it's there alright.
Can you cut this kind of thing down though?

<table cellpadding="0" cellspacing="0" border="0" class="tborder" width="100%">
That appears multiple times in the skin...
Perhaps I'm just ranting at a brick wall... and the vBulletin team didn't design the skin system as cleanly as they could have done.

I'd love to at least get the CSS definitions out of the header and into a seperate file.
[align=center]
Image
Banner above created using my avatar generator tool.
You know you want try it.
User avatar
Straylight
 
Posts: 2346
Joined: Mon May 26, 2003 12:00 pm
Location: Manchester, UK

Postby Fsiphskilm » Wed Apr 14, 2004 5:34 pm

What I'm trying to s
Last edited by Fsiphskilm on Sat Jan 14, 2017 10:55 pm, edited 1 time in total.
I'm leaving CAA perminantly. i've wanted to do this for a long time but I've never gathered the courage to let go.
User avatar
Fsiphskilm
 
Posts: 3853
Joined: Mon Nov 03, 2003 12:00 pm
Location: USA

Postby Mithrandir » Thu Apr 15, 2004 8:39 am

Well, here's the code from the previous example...

Code: Select all
<table border=0 cellspacing=1 cellpadding=5 class="tborder" width=100%>
<tr>
 <td class="redbar" align="center">
 <font class="navbar">- Session Tracking and Debug Information -</font>
 </td>
</tr>
<tr>
 <td class="bare">
 <table border=0 cellpadding=0 cellspacing=0 width=100%>
 <tr>
  <td class="bare"><font class="disclaimer">You are currently logged in as root</font></td>
  <td align=right class="bare"><font class="disclaimer">04/15/2004 - 08:33 am - nnn.nnn.nnn.nnn</font></td>
 </tr>
 </table>
 </td>
</tr>
</table>


All the td deffs and font deffs are pulled out of the CSS. I acutally prefer this, since some times I want a piece of this deff and a piece of that deff, without having to define a new div, you know?

I guess it's really a question of whether you want flexibility, or uniformity. I find that with a little extra HTML on the page, I can get the flexibility I need, and the uniformity that comes out of the CSS.
User avatar
Mithrandir
 
Posts: 11071
Joined: Fri Jun 27, 2003 12:00 pm
Location: You will be baked. And then there will be cake.


Return to Computing and Links

Who is online

Users browsing this forum: No registered users and 97 guests