Web Design Forums

HTML and CSS Help

Having problems with these web design scripting? Ask here.

div instead of table



Site of the Month Nominations
ENTER YOUR SITE NOW!

Reply
 
LinkBack Thread Tools
Old June 13 '09, 11:39 AM (#1)
MaryJo is offline
WDF Member
 
MaryJo's Avatar
 
Join Date: May 2008
Posts: 47
MaryJo is an unknown quantity at this point
div instead of table

My instructor started out teaching us how to create a page with tables. As I understand it that is the old way of doing it. Are div's used to set up the page instead of tables? As I understand it you should only use a table unless you are going to have tabular data. Is that correct?

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 13 '09, 03:41 PM (#2)
filburt1 is offline
bored
 
filburt1's Avatar
 
Join Date: July 2002
Location: Maryland, US
Posts: 11,785
filburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to all
Not only is it an "old" way of doing it, it's the wrong way. However, using just a bunch of div tags is also not necessarily correct. You should use the correct tag for the job, and if one won't do but you still need one, use <div> for a block item or <span> for something inline.

For example, if you have a list of items that comprise a sidebar, you shouldn't use a table nor a div for it. Instead, a <ul> makes sense because you're representing an unordered list, which is the purpose of the <ul> tag. Tables should only be used for tabular data.

I can't believe anybody would still teach table-based designs. They were wrong but effectively necessary about 7 or 8 years ago. Now they're wrong and there are limitless ways of acheiving the same result without using tables.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 13 '09, 06:38 PM (#3)
Hitch - CP is offline
WDF Member
 
Hitch - CP's Avatar
 
Join Date: June 2009
Location: London
Posts: 84
Hitch - CP is on a distinguished road
Sometimes tables are necessary (although admittedly rarely) if you want to present tabular data like in excel but on a webpage. This isn't needed very often and I have never used tables as div are so much more useful with the use of CSS as well; they are what should be used as a standard these days.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 13 '09, 11:43 PM (#4)
filburt1 is offline
bored
 
filburt1's Avatar
 
Join Date: July 2002
Location: Maryland, US
Posts: 11,785
filburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to all
Using tables to represent tabular data is just fine. In fact what you just said is the metaphor I most often use: if it would naturally work in Excel, then it's probably tabular data and HTML tables are the correct thing. Otherwise, they're not.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 15 '09, 12:40 PM (#5)
MaryJo is offline
WDF Member
 
MaryJo's Avatar
 
Join Date: May 2008
Posts: 47
MaryJo is an unknown quantity at this point
Thanks everyone for clarifying what to use when.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 18 '09, 06:52 AM (#6)
stanneon is offline
New Member!
 
stanneon's Avatar
 
Join Date: June 2009
Posts: 8
stanneon is an unknown quantity at this point
That's right, table is for tabular data only. But that was way way back, now you could almost do anything using DIV including displaying tabular data...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 23 '09, 10:18 AM (#7)
blackrhino is offline
WDF Member
 
blackrhino's Avatar
 
Join Date: February 2009
Posts: 36
blackrhino is an unknown quantity at this point
Tables are used for data. Div's are used for layouts. Plus it's much easier for google to navigate your site if you use divs and SEO goes much smoother.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 23 '09, 10:33 AM (#8)
filburt1 is offline
bored
 
filburt1's Avatar
 
Join Date: July 2002
Location: Maryland, US
Posts: 11,785
filburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to allfilburt1 is a name known to all
Quote:
Originally Posted by blackrhino
Tables are used for data. Div's are used for layouts. Plus it's much easier for google to navigate your site if you use divs and SEO goes much smoother.
Tables are used for data, but divs are not used for layout. A <div> tag means a division, or a logical group of content on a page. No tag in XHTML should be used for its layout behavior. The entire point of semantic HTML is not to use divs but to use the right tag to describe the data. 90% of the time it won't be a div, but a p, ul, ol, etc.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 23 '09, 10:44 AM (#9)
blackrhino is offline
WDF Member
 
blackrhino's Avatar
 
Join Date: February 2009
Posts: 36
blackrhino is an unknown quantity at this point
Yes you will use those tags as well, however you still need div's within most layouts.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 23 '09, 01:09 PM (#10)
Dorky is offline
Freelance
 
Dorky's Avatar
 
Join Date: June 2009
Location: Destin Florida
Posts: 905
Dorky will become famous soon enough
it didnt think it was an either or situation. i have seen the video put out by google on seo, and they said some very dif thing then any of what i see i this thread.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 3 '09, 02:22 AM (#11)
nitin is offline
New Member!
 
nitin's Avatar
 
Join Date: July 2009
Posts: 14
nitin is an unknown quantity at this point
using div in table would be very useful for the navigation.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 3 '09, 02:40 AM (#12)
Curtster is offline
New Member!
 
Curtster's Avatar
 
Join Date: February 2008
Posts: 15
Curtster is an unknown quantity at this point
css is definitely the best way to do a layout. I still use tables in my pages often though personally, for when I just want to easily line things up side by side, in columns, or in a grid layout. For the layout of my page though, I use all css with div tags. Although as said above, it is probably proper to use other types of tags as well.

I had to take a intro to web development course in college this year, and the professeur siad that is pretty much a toss up between tables and css for layout. He said he preferred to use tables, probably just because he is old school. I sent him an email on the subject but never got a response haha. So yeah, table layouts are still being taught in school, even though they are archaic. They are also much more difficult to code and handle I think, so much harder for people to learn.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

  Web Design Forums » Programming Help » HTML and CSS Help

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is diffrence between table and div desing? extomas General Web Design Discussion 12 June 13 '09 03:54 PM
format of links in a div or table ketanco HTML and CSS Help 2 February 9 '09 04:05 PM
Need someone who is great at Firexo/IE CSS discrepency issues... kennedrw HTML and CSS Help 1 November 14 '07 03:21 AM
Need Myspace Code Help Audiologic HTML and CSS Help 3 November 1 '07 11:22 AM
empty div acting as a table cell with 100% height for whitespaces blue_francis14 HTML and CSS Help 7 June 15 '07 06:09 PM

 
User Infomation
Your Avatar

Site Of The Month

Ticket Cake
Ticket Cake

Ticket Cake is a drupal based event ticketing platform. It features that ability to browse events and share them.

Nominate Your Site Now!

Advertisement
WolfCMS.org

Latest Articles
- by RickM
- by bfsog

Advertisement

Partner Links



All times are GMT -4. The time now is 02:47 AM.


WebDesignForums.net is Copyright © 2010 RikeMedia.

SEO by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163