473,396 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

DIV vs TABLE

Hi all

I heard recently that using DIVs instead of Tables for laying out your page
was the way forward.

Can anyone give me a good reason why I should use DIVs, I think they're are
pain in the backside personally and can never really get my head around
them.

What are the advantages? Do I HAVE to use them? If so, why? How will it
affect any new sites I develop?

Thanks all
Kev
Apr 24 '06 #1
11 1379
Just pick what fits your needs. An advantage for DIVs is that it allows to
reorder columns when using a column layout.

Try for example :
http://www.csszengarden.com/

I admit it's likely overkill for us mere mortals...

--
Patrice

"Mantorok" <ma******@mantorok.com> a écrit dans le message de news:
e2**********@newsfeed.th.ifl.net...
Hi all

I heard recently that using DIVs instead of Tables for laying out your
page was the way forward.

Can anyone give me a good reason why I should use DIVs, I think they're
are pain in the backside personally and can never really get my head
around them.

What are the advantages? Do I HAVE to use them? If so, why? How will it
affect any new sites I develop?

Thanks all
Kev

Apr 24 '06 #2
Tables are still quite acceptable for displaying layout elements that are in
a tabular layout format, and in fact can be better than divs with such
layout. However, divs are more flexible for the same reason - they do not
restrict the layout to tabular format. Instead, a div is like a "floating
box" that can beo positioned anywhere you want. Patrice's linke to
csszengarden.com is the best example I know of regarding the power of divs
for layout. Every page is the same content with a different style sheet
applied.

This means that you can change the look of your web pages without touching
any of the content.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

"Mantorok" <ma******@mantorok.com> wrote in message
news:e2**********@newsfeed.th.ifl.net...
Hi all

I heard recently that using DIVs instead of Tables for laying out your
page was the way forward.

Can anyone give me a good reason why I should use DIVs, I think they're
are pain in the backside personally and can never really get my head
around them.

What are the advantages? Do I HAVE to use them? If so, why? How will it
affect any new sites I develop?

Thanks all
Kev

Apr 24 '06 #3
I think this famous site makes it clear. If you are more a designer than a
programmer, go for divs with css. If you are more a programmer, stick with
the tables and leave the divs for the designers.

Eliyahu

"Patrice" <sc****@chez.com> wrote in message
news:ul**************@TK2MSFTNGP03.phx.gbl...
Just pick what fits your needs. An advantage for DIVs is that it allows to
reorder columns when using a column layout.

Try for example :
http://www.csszengarden.com/

I admit it's likely overkill for us mere mortals...

--
Patrice

"Mantorok" <ma******@mantorok.com> a écrit dans le message de news:
e2**********@newsfeed.th.ifl.net...
Hi all

I heard recently that using DIVs instead of Tables for laying out your
page was the way forward.

Can anyone give me a good reason why I should use DIVs, I think they're
are pain in the backside personally and can never really get my head
around them.

What are the advantages? Do I HAVE to use them? If so, why? How will it
affect any new sites I develop?

Thanks all
Kev


Apr 24 '06 #4
Ok thanks.

I find divs a nightmare though - is there actually any good guides/help on
how to use them?

If I was to produce a site without using DIVs - will it bite me on the arse
later on in life?

Thanks
Kev

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
Tables are still quite acceptable for displaying layout elements that are
in a tabular layout format, and in fact can be better than divs with such
layout. However, divs are more flexible for the same reason - they do not
restrict the layout to tabular format. Instead, a div is like a "floating
box" that can beo positioned anywhere you want. Patrice's linke to
csszengarden.com is the best example I know of regarding the power of divs
for layout. Every page is the same content with a different style sheet
applied.

This means that you can change the look of your web pages without touching
any of the content.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

"Mantorok" <ma******@mantorok.com> wrote in message
news:e2**********@newsfeed.th.ifl.net...
Hi all

I heard recently that using DIVs instead of Tables for laying out your
page was the way forward.

Can anyone give me a good reason why I should use DIVs, I think they're
are pain in the backside personally and can never really get my head
around them.

What are the advantages? Do I HAVE to use them? If so, why? How will it
affect any new sites I develop?

Thanks all
Kev


Apr 24 '06 #5
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:Ou**************@TK2MSFTNGP03.phx.gbl...
I think this famous site makes it clear. If you are more a designer than a
programmer, go for divs with css. If you are more a programmer, stick with
the tables and leave the divs for the designers.


That sounds good to me :-)

As long as by using tables I won't be giving myself enough rope......then I
don't mind.

Kev
Apr 24 '06 #6
Do you mind changing the HTML code in case you would update your design or
would you like to have third party (or yourself) to be able to change the
layout using only a CSS stylesheet (themes).

If yes, using DIVs and CSS will give more flexibility but is likely a bit
logner to implement depneidng on what exactly you are trying to do, else you
can keep using tables...

--
Patrice

"Mantorok" <ma******@mantorok.com> a écrit dans le message de news:
e2**********@newsfeed.th.ifl.net...
Ok thanks.

I find divs a nightmare though - is there actually any good guides/help on
how to use them?

If I was to produce a site without using DIVs - will it bite me on the
arse later on in life?

Thanks
Kev

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
Tables are still quite acceptable for displaying layout elements that are
in a tabular layout format, and in fact can be better than divs with such
layout. However, divs are more flexible for the same reason - they do not
restrict the layout to tabular format. Instead, a div is like a "floating
box" that can beo positioned anywhere you want. Patrice's linke to
csszengarden.com is the best example I know of regarding the power of
divs for layout. Every page is the same content with a different style
sheet applied.

This means that you can change the look of your web pages without
touching any of the content.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

"Mantorok" <ma******@mantorok.com> wrote in message
news:e2**********@newsfeed.th.ifl.net...
Hi all

I heard recently that using DIVs instead of Tables for laying out your
page was the way forward.

Can anyone give me a good reason why I should use DIVs, I think they're
are pain in the backside personally and can never really get my head
around them.

What are the advantages? Do I HAVE to use them? If so, why? How will it
affect any new sites I develop?

Thanks all
Kev



Apr 24 '06 #7
> I find divs a nightmare though - is there actually any good guides/help on
how to use them?
They're only a nightmare if you have to deal with IE.

Actually, DIVs/CSS aren't THAT difficult...it's just that we've all 'grown
up' using Tables, so it's different.
If I was to produce a site without using DIVs - will it bite me on the
arse later on in life?


I doubt it.

But, the sooner you learn and deal with them, the more confident you'll be
when you make decisions as to which one to use.

-Darrel
Apr 24 '06 #8
On Mon, 24 Apr 2006 10:21:37 +0100, Mantorok wrote:
Hi all

I heard recently that using DIVs instead of Tables for laying out your page
was the way forward.
Yes and no.
Can anyone give me a good reason why I should use DIVs, I think they're are
pain in the backside personally and can never really get my head around
them.

What are the advantages? Do I HAVE to use them? If so, why? How will it
affect any new sites I develop?


No, you don't HAVE to do much of anything. However, good web design
specifies seperating content from presentation. That is, seperating the
actual text of your site from it's layout and style.

Tables have many problems, including being more difficult for those with
disabilities to read, as well as making it more difficult for search
engines to find relevant information.

div/css based sites tend to get better page ranks in google and other
crawlers because the site is "semantically" relevant. That is, you've
tagged parts of your page with bits of information that defines its
importance, such as using h1/h2/h3 tags, etc...

Nothing is preventing you from designing sites as you always have, and 95%
of your audience will probably never care. But if you want to be
accessible to those with disabilities (a requirement for government and
educational sites, and a growing requirement for corporations - see the
Target Companies lawsuit), then semantic design is the way to go.

Another benefit is that div/css based sites tend to use a lot less
bandwidth, which can save you real money if you pay per megabyte for your
hosting.
Apr 24 '06 #9
The only thing you'll do is make it harder to change the layout in the
future.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

"Mantorok" <ma******@mantorok.com> wrote in message
news:e2**********@newsfeed.th.ifl.net...
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:Ou**************@TK2MSFTNGP03.phx.gbl...
I think this famous site makes it clear. If you are more a designer than a
programmer, go for divs with css. If you are more a programmer, stick with
the tables and leave the divs for the designers.


That sounds good to me :-)

As long as by using tables I won't be giving myself enough rope......then
I don't mind.

Kev

Apr 24 '06 #10
Hello Kev,

My personal favorite book on the subject is JavaScript + Css + DOM Magic by
Makiko Itoh. The book's layout is ... unique. It doesn't have the typical
programming book layout. My guess is that it is more aimed at designers.
ymmv. You can find it on amazon.
--
enjoy - brians
http://www.limbertech.com
"Mantorok" wrote:
Ok thanks.

I find divs a nightmare though - is there actually any good guides/help on
how to use them?

If I was to produce a site without using DIVs - will it bite me on the arse
later on in life?

Thanks
Kev

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
Tables are still quite acceptable for displaying layout elements that are
in a tabular layout format, and in fact can be better than divs with such
layout. However, divs are more flexible for the same reason - they do not
restrict the layout to tabular format. Instead, a div is like a "floating
box" that can beo positioned anywhere you want. Patrice's linke to
csszengarden.com is the best example I know of regarding the power of divs
for layout. Every page is the same content with a different style sheet
applied.

This means that you can change the look of your web pages without touching
any of the content.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

"Mantorok" <ma******@mantorok.com> wrote in message
news:e2**********@newsfeed.th.ifl.net...
Hi all

I heard recently that using DIVs instead of Tables for laying out your
page was the way forward.

Can anyone give me a good reason why I should use DIVs, I think they're
are pain in the backside personally and can never really get my head
around them.

What are the advantages? Do I HAVE to use them? If so, why? How will it
affect any new sites I develop?

Thanks all
Kev



Apr 24 '06 #11
Mantorok wrote:
Hi all

I heard recently that using DIVs instead of Tables for laying out your page
was the way forward.

Can anyone give me a good reason why I should use DIVs, I think they're are
pain in the backside personally and can never really get my head around
them.


1. Long page with DIV tags rendered much faster then TABLE.
If you can use fixed-layout table rendering speed the same.
2. Use DIV if you have big amount of data. And layout depends from
browser screen resolution (width in percent).
If you display small data amount it's usually no difference, but
TABLES preferred way for displaying regular data structure.

Apr 25 '06 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Gaz | last post by:
Hi, I need to have a table nested within another table. The tables are alongside each other visually speaking, and the nested table (on the right) can vary in size. My problem is that when the...
61
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will...
3
by: Terrence Brannon | last post by:
I don't know what Postgres considers a relation and had no intention of creating one when piping my schema to it... I always DROP TABLE before CREATE TABLE, so here are the ERRORS emitted when...
4
by: maricel | last post by:
I have the following base table structure - DDL: CREATE TABLE "ADMINISTRATOR"."T1" ( "C1" INTEGER NOT NULL ) IN "TEST_TS" ; ALTER TABLE "ADMINISTRATOR"."T1" ADD PRIMARY KEY
4
by: Simone Battagliero | last post by:
I wrote a program which inserts and finds elements in an hash table. Each element of the table is a dinamic list, which holds all elements having the same hash value (calculated by an int...
117
by: phil-news-nospam | last post by:
Is there really any advantage to using DIV elements with float style properies, vs. the old method of TABLE and TR and TD? I'm finding that by using DIV, it still involves the same number of...
76
MMcCarthy
by: MMcCarthy | last post by:
Normalisation is the term used to describe how you break a file down into tables to create a database. There are 3 or 4 major steps involved known as 1NF (First Normal Form), 2NF (Second Normal...
7
by: Kamal | last post by:
Hello all, I have a very simple html table with collapsible rows and sorting capabilities. The collapsible row is hidden with css rule (display:none). When one clicks in the left of the...
5
by: wugon.net | last post by:
question: db2 LUW V8 UNION ALL with table function month() have bad query performance Env: db2 LUW V8 + FP14 Problem : We have history data from 2005/01/01 ~ 2007/05/xx in single big...
5
by: jrod11 | last post by:
hi, I found a jquery html table sorting code i have implemented. I am trying to figure out how to edit how many colums there are, but every time i remove code that I think controls how many colums...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.