Ask Experts Questions for FREE Help !
Ask
    pbishnu's Avatar
    pbishnu Posts: 3, Reputation: 1
    New Member
     
    #1

    Apr 21, 2008, 04:07 AM
    Table or div?
    Hi all,
    I am always using tables to align text and images in web pages. I thing div can also be used for the same purpose. Which is a better options to use? Should I move to div from using table?
    Thank you
    Northwind_Dagas's Avatar
    Northwind_Dagas Posts: 348, Reputation: 83
    Full Member
     
    #2

    Apr 21, 2008, 12:14 PM
    Div, like span, is used to apply formatting to text between the tags. Unlike span, div has line breaks after each section. Also, you will not be able to accomplish the same structure with div that you can do with tables.
    teddy0bear's Avatar
    teddy0bear Posts: 64, Reputation: 4
    Junior Member
     
    #3

    Nov 9, 2008, 11:20 PM

    Div tags! Or more importantly CSS. I've used tables a lot in the past but I am finding now that if you are serious about getting a job in the field they require that you know how to style a page with css and div tags. I used to only use css for text but now with div tags you can control everything. It is also great if you have to make a change to the web page. Instead of changing all 15 pages of your site when you have to make a change you just make a quick change to your master css page and your done!

    And that extra line break with the div codes, combined with css you won't see it anymore.
    crigby's Avatar
    crigby Posts: 4,343, Reputation: 107
    Outdoor Power Equipment Expert
     
    #4

    Nov 23, 2008, 01:02 PM

    Hi,
    I agree with the second answer. Div's are more accessible and do a far better job of formatting. This is from one who was a dyed-in-the-wool user of embedded tables from the days of HTML 2.0. I could give one of my addresses to show before and after, but let me give you the site of the best example I have seen of Div's:
    internet.com - the Internet and IT Network from Jupitermedia Corp.
    Peace,
    Clarke
    Artem's Avatar
    Artem Posts: 61, Reputation: 5
    Junior Member
     
    #5

    Jan 14, 2009, 01:01 PM
    Quote Originally Posted by Northwind_Dagas View Post
    Div, like span, is used to apply formatting to text between the tags. Unlike span, div has line breaks after each section. Also, you will not be able to accomplish the same structure with div that you can do with tables.

    UUR.. Wrong. Div's can do the same as tables, even more.
    But we can't say which is the better way, since even in Dreamweaver the Table button is also set under the 'Layout'-tab.

    I see it like this: Div + Css = lay-out
    Table: arranging inside div content
    Zurvan's Avatar
    Zurvan Posts: 5, Reputation: 1
    New Member
     
    #6

    Jan 31, 2009, 08:33 AM

    Tables are there to present tabular data, not to layout your screen. They were used that way because there was no alternative. Now that CSS is available - and pretty well standardized across browsers - there's no reason to use tables to layout your screen. Besides that, think of how difficult it is to add a piece of information to the middle of your screen with tables, compared to a CSS layout - a far more common operation than a complete redesign (which is also easier with CSS).

    If you want to know why, go to a website laid out with tables and turn on your screen reader. Then do the same thing with a well-designed page of CSS. Besides the accessibility issues, tables use far more markup, which creates (much) larger files that need to be downloaded, costing you bandwidth and slower loading times.

    To see some of the magic of CSS, check out css Zen Garden: The Beauty in CSS Design. It will blow you away.
    WebsiteSolution's Avatar
    WebsiteSolution Posts: 85, Reputation: 10
    Junior Member
     
    #7

    Feb 5, 2009, 05:40 AM

    I don't think there is one definte answer. DIV is great, tables are great. I must admit that sometimes it is easier and faster to use a table than to get my DIV to work properly. Why not try using both and then you can make the decision as to which is easier and most comfortable for you.
    CSS is wonderful!

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Can I get a table by the window? [ 17 Answers ]

6118 Dinner in the islands! Ahhhhhh! Yep, that's what I had in mind! Now, how much extra for a dry napkin? I dropped mine...

What table saw would you recommend? [ 5 Answers ]

Hello. I am trying to purchase a good multifunction table saw. I will be working on projects from models for class to renovating homes. What brand, type, etc would you recommend in a couple of different price ranges (for example $100-$200, $200-$400 etc.)? I was looking at two craftsman...


View more questions Search