What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » [self-split] tables vs. divs

Pages: (4): « First [ 1 ] 2 3 4 » Last »
[self-split] tables vs. divs
Author: Message:
WDZ
Former Admin
*****

Avatar

Posts: 7106
Reputation: 107
– / Male / Flag
Joined: Mar 2002
O.P. [self-split] tables vs. divs
quote:
Originally posted by Lee Jeffery
quote:
Originally posted by WDZ
Tables rule. :tongue:
no!!!111
divs!!!111
Divs don't have cells or columns or rows. :-/

I've heard people say tables should be replaced by CSS, but I don't think anything can really replace the simplicity and usefulness of a good old table. They're a great and fairly reliable way to lay out the elements of a page.

I've tried to use CSS positioning and aligning and all I got from it was a major headache.

Discuss. :p
07-09-2005 10:10 AM
Profile PM Web Find Quote Report
Sunshine
Elite Member
*****

Avatar

Posts: 5142
Reputation: 122
– / Female / Flag
Joined: Mar 2004
Status: Away
RE: [self-split] tables vs. divs
Making a homepage strictly outta divs aint easy, i tried it and gave up because i couldn't get it to center on all screen resolutions. You can use percentages but i think to let the second or third column on certain place you do need absolute positioning...not that difficult but when you want it to look good on all resolutions you get stuck.

Tables can be very confusing and complicated on the other hand...i only use the simple 2 and 3 column ones with no borders.
[Image: 25dr3o9]
07-09-2005 10:20 AM
Profile E-Mail PM Web Find Quote Report
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
RE: [self-split] tables vs. divs
tip for centering

body {
        text-align:center;
}

then all divs add style="margin:0 auto;"
07-09-2005 10:21 AM
Profile PM Find Quote Report
Sunshine
Elite Member
*****

Avatar

Posts: 5142
Reputation: 122
– / Female / Flag
Joined: Mar 2004
Status: Away
RE: [self-split] tables vs. divs
Yeah ok Leejeffy i knew that, but how do you get divs starting at a certain place without having to absolute position it...and so it will look same on all screen resolutions (autoadjusting div width)?
[Image: 25dr3o9]
07-09-2005 10:25 AM
Profile E-Mail PM Web Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
35 / Male / Flag
Joined: Mar 2004
RE: [self-split] tables vs. divs
tables can be fine if not overused (I count over used as this forum lol)
eg theres 32 uses of <table> in this forum!

tables are fine for data , eg topics and posts etc
but they arnt fine for use in positioning your headings , they work but are blah.

hell I would love to see a forum not over use tables and use a nice amount of divs + tables.

so don't everyone go "oh divs should be used in everything"
sure they can be used in a forum but it would require alot of work to do so and wouldnt feel or look as good.
remember kids tables are for data
divs are for everything else ;)
[Image: dt2.0v2.png]      Happy Birthday, WDZ
07-09-2005 10:26 AM
Profile PM Web Find Quote Report
ShawnZ
Veteran Member
*****

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
Joined: Jan 2003
RE: [self-split] tables vs. divs
quote:
Originally posted by Sunshine
Yeah ok Leejeffy i knew that, but how do you get divs starting at a certain place without having to absolute position it...and so it will look same on all screen resolutions (autoadjusting div width)?

<style>
#randomdiv {
  position: absolute;
  left: 50%;
  margin-left: -100px; // Half of what you want the width to be

  top: 50%;
  margin-top: -100px; // Half of what you want the height to be

  width: 200px;
  height: 200px;
}
</style>

<div id="randomdiv">This text is in a centered box 200x200 pixels big</div>

Got the trick from TheGeek, thank him.

There is one more possibly easier way to do it:

<style>
body {
  margin: 0px auto;
  width: 100%;
  height: 100%;
}
#randomdiv {
  margin 0px auto;
  width: 200px;
  height: 200px;
}
</style>
Also, if you want something to be positioned around that, just center it at 50% and set the leftmargin to how far away it should be from the center

This post was edited on 07-09-2005 at 06:16 PM by ShawnZ.
Spoiler:
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
07-09-2005 03:30 PM
Profile PM Web Find Quote Report
hmaster
Senior Member
****

Avatar

Posts: 716
Reputation: 24
33 / Male / Flag
Joined: Nov 2004
RE: [self-split] tables vs. divs
I prefer divs, using tables get a bit complicated after a bit.
The homepage i currently use for my site (click sig) is all using divs but its not always centered :/
Im going to use the tip that lee said but there are many ways to do it with css.
Blue Robot CSS Center 1
Blue Robot CSS Center 2
[Image: sig.png]
07-09-2005 05:02 PM
Profile PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: [self-split] tables vs. divs
quote:
Originally posted by -dt-
tables can be fine if not overused (I count over used as this forum lol)
eg theres 32 uses of <table> in this forum!
so???? that means absolutely nothing...

quote:
Originally posted by -dt-
tables are fine for data , eg topics and posts etc
but they arnt fine for use in positioning your headings , they work but are blah.
I'm sorry but this is nonsense...

------------------

Tables are 100 times (if not more) easier then div's to create tables... And there is no such thing as overusing them. There is however something like misusing them and not knowing when and how to use them (resulting in comments like "tables are crap and old").

eg: This forum, unlike -dt- suggested, is a nice example of how to use tables in a good way. Yes, it can be complicated to some, but with div's it would be much more complicated and div's are still not completely 100% supported and implemented in the same way in each and every browser.

Tables are much more easier and structured then div's to use for tables once you're used to them and are used to the easy structure of tables. Heck they are made especially to create tables :/ div's not!

Div's can be used in place of tables and there is no harm in doing it. But in most cases it isn't needed at all and div's can (should) be used for a lot more other things and not only for the purpose to replace tables because you think tables are crap.

In fact div's can't be compared to tables at all, they are both a total different kind of html code... (and don't bring CSS into this as it has actually nothing to do with it since CSS can also be used with tables just the same. The only difference is that CSS is associated more with div's than with tables, making it a total misconception that div=css and table=old style non css html)

I'm sorry, but those who say tables are redundant crap and shouldn't be used at all, should learn html a bit more. For each there is a proper time and place to use it ;)


------------------

Exactly the same story goes for frames vs iframes, etc.. btw

This post was edited on 07-09-2005 at 05:46 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
07-09-2005 05:33 PM
Profile PM Find Quote Report
surfichris
Former Admin
*****

Avatar

Posts: 2365
Reputation: 81
Joined: Mar 2002
RE: [self-split] tables vs. divs
However. Tables should only be used to hold tabular data. For positioning headings etc it is (as dt suggested) just stupid.

In MyBB it uses tables to even position the New Thread and Post Reply images on the right - this should not be the case.

quote:
Tables are 100 times (if not more) easier then div's to create tables...
<table>
<tr>
  <td>Test</td>
</tr>
</table>

<div>Test</div>

Looks easier to me - and then if you want to further it you should be using CSS (even for the table) to promote accessibility and usability.

quote:
Yes, it can be complicated to some, but with div's it would be much more complicated and div's are still not completely 100% supported and implemented in the same way in each and every browser.
They're 100% supported in every browser, its apart of a very old HTML specification. Implemented in each browser would refer to the CSS, and it's basically because of Microsoft not following standards that things don't work outright.

quote:
Div's can be used in place of tables and there is no harm in doing it. But in most cases it isn't needed at all and div's can (should) be used for a lot more other things and not only for the purpose to replace tables because you think tables are crap.

Tables for tabular data, Div's for layouts.
07-10-2005 04:02 AM
Profile PM Find Quote Report
L. Coyote
Senior Member
****

Avatar
Captain Obvious

Posts: 981
Reputation: 49
38 / Male / Flag
Joined: Aug 2004
Status: Away
RE: [self-split] tables vs. divs
quote:
Originally posted by Chris Boulton
<table>
<tr>
  <td>Test</td>
</tr>
</table>

<div>Test</div>

Looks easier to me - and then if you want to further it you should be using CSS (even for the table) to promote accessibility and usability.
It's not like the example you gave is terribly difficult. :tongue: Besides, EASY != LESS CHARACTERS.

For example, you worry less when sorting out the position and size of each cell, while the DIVs are a little more complicated to position.

The problem I see with DIV is that it depends too much on CSS, and that is why it's always confused with said coding, and some browsers might have a difficult time with showing the website (because of new/old CSS, not because of DIV).

Tables are supported in all browsers (just like DIV), but they don't require any advanced CSS for positioning. It makes it easy to sort out the content in it.

The only times I use DIVs is when I have a small chunk of text with very different formats and they need to be in blocks. For such small space, using a table isn't exactly convenient.

Meh, I'm rambling...

Hack, hack, hack!
Finally became a Systems Analyst! :spam:

07-10-2005 04:19 AM
Profile PM Find Quote Report
Pages: (4): « First [ 1 ] 2 3 4 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On