| Web Design Lobby Forum for general web design issues not specific to scripting or graphics. |
08-08-2006, 11:22 PM
|
#1 (permalink)
|
|
Inactive
Join Date: 08-08-06
Posts: 8
Latest Blog: None
|
Table or Div
What do you think should be used for website layouts? I've been reading online, and have seen many mixed oppinions. I've been reading this site for the past few days and you guys seem like you know what you are talking about. I'm debating on which route I should choose on my next website. Thanks for all input.
|
|
|
08-09-2006, 12:42 AM
|
#2 (permalink)
|
|
v7n Mentor
Join Date: 03-09-06
Location: London UK
Posts: 2,802
|
Jordonias, it all depends on how well you want to structure your code.
Symantic markup is a big deal at the moment, for many reasons including accessibility. This in essence is using (X)HTML tags to describe what content it contains. For example, navigation is generally considered a list. So it should be contained within either <ul> (unordered list) or <ol> (ordered list) tags. On the flip side, layout isn't tabular data, so it shouldn't be in <table> tags.
I use to design in tables but now only using CSS and HTML 4.01 STRICT although some designers still use tables. There are pros and cons, you need to weigh them up and decide what is best for you.
|
|
|
08-09-2006, 01:56 AM
|
#3 (permalink)
|
|
v7n Mentor
Join Date: 01-26-06
Location: netherlands
Posts: 2,214
Latest Blog: None
|
I used to do it all in tables, but got forced using divs for practical reasons(coding wise) and now I'm doing pretty o.k with css and think that divs are better and easier
|
|
|
08-09-2006, 02:09 AM
|
#4 (permalink)
|
|
Inactive
Join Date: 12-19-05
Location: Berkeley, California
Posts: 515
Latest Blog: None
|
I believe table based sites load slower than a div based site? It seems that div is the new things and tables are on their way out. All the CMSs are trying to get all their followers to make div templates.
|
|
|
08-09-2006, 02:55 AM
|
#5 (permalink)
|
|
Inactive
Join Date: 12-19-05
Location: Berkeley, California
Posts: 515
Latest Blog: None
|
This post inspired me to learn a lil more about divs and actually once you get the hang of it they are somewhat addicting over tables. I feel like its soo much cleaner code. Certainly is less code so you get a higher content to code ratio goin.
|
|
|
08-09-2006, 03:00 AM
|
#6 (permalink)
|
|
v7n Mentor
Join Date: 01-26-06
Location: netherlands
Posts: 2,214
Latest Blog: None
|
Quote:
|
Originally Posted by theChronic
This post inspired me to learn a lil more about divs and actually once you get the hang of it they are somewhat addicting over tables. I feel like its soo much cleaner code. Certainly is less code so you get a higher content to code ratio goin.
|
Go for it! definantly worth it 
|
|
|
08-09-2006, 05:42 AM
|
#7 (permalink)
|
|
Empress™
Join Date: 08-19-04
Location: York, UK
Posts: 18,004
|
CSS positioning > tabular structure.
In my experience, anyway. It's a sharp learning curve, but worth the climb.
|
|
|
08-09-2006, 06:55 AM
|
#8 (permalink)
|
|
Inactive
Join Date: 08-08-06
Posts: 8
Latest Blog: None
|
Thanks for the input
Thanks for the input, I've been playing with divs but I have come to problems making divs side by side horizontally. I've looked online and have seen many different ways to do this, can anyone show me or tell me the easiest and best way to go about doing this?
|
|
|
08-09-2006, 07:07 AM
|
#9 (permalink)
|
|
Empress™
Join Date: 08-19-04
Location: York, UK
Posts: 18,004
|
Floating divs.
float: left applied to both divs, with each given a width value.
|
|
|
08-09-2006, 07:13 AM
|
#10 (permalink)
|
|
Inactive
Join Date: 08-08-06
Posts: 8
Latest Blog: None
|
Ok, say for some odd reason I wanted to have a row with 1 column, then a row with 3 columns, then a row with 2 columns.
|
|
|
08-09-2006, 07:28 AM
|
#11 (permalink)
|
|
Empress™
Join Date: 08-19-04
Location: York, UK
Posts: 18,004
|
Code:
<div style="width:900px;">one column</div>
<div style="width:450px; float:left;">two column</div>
<div style="width:450px; float:left;">two column</div>
<div style="clear:both;"></div>
<div style="width:300px; float:left;">three column</div>
<div style="width:300px; float:left;">three column</div>
<div style="width:300px; float:left;">three column</div>
<div style="clear:both;"></div>
|
|
|
08-09-2006, 08:16 AM
|
#12 (permalink)
|
|
Inactive
Join Date: 08-08-06
Posts: 8
Latest Blog: None
|
Quote:
|
Originally Posted by chicgeek
Code:
<div style="width:900px;">one column</div>
<div style="width:450px; float:left;">two column</div>
<div style="width:450px; float:left;">two column</div>
<div style="clear:both;"></div>
<div style="width:300px; float:left;">three column</div>
<div style="width:300px; float:left;">three column</div>
<div style="width:300px; float:left;">three column</div>
<div style="clear:both;"></div>
|
Thank you very much chicgeek, I think I understand now.
|
|
|
08-09-2006, 08:18 AM
|
#13 (permalink)
|
|
Empress™
Join Date: 08-19-04
Location: York, UK
Posts: 18,004
|
No problem.  Let us know if it works out as you had hoped!
|
|
|
08-09-2006, 08:30 AM
|
#14 (permalink)
|
|
Contributing Member
Join Date: 07-08-06
Location: Here
Posts: 239
Latest Blog: None
|
Quote:
|
Originally Posted by theChronic
I believe table based sites load slower than a div based site? It seems that div is the new things and tables are on their way out. All the CMSs are trying to get all their followers to make div templates.
|
yes, that's true especially if the layout is complicated. the code for the table layout alone can be very much longer than css coding...
i used to code exclusively using tables... until i tried to hack a wordpress skin... then i realized that css is really much easier. the only problem with css is that sometimes firefox and ie interpretes them differently and you have to tweak the code over and over again until it appears 'almost' the same in both browsers.
but no looking back, i'm bought over by css now... 
|
|
|
08-09-2006, 08:32 AM
|
#15 (permalink)
|
|
Empress™
Join Date: 08-19-04
Location: York, UK
Posts: 18,004
|
That'll be one soul, please.
|
|
|
08-09-2006, 08:35 AM
|
#16 (permalink)
|
|
Inactive
Join Date: 08-08-06
Posts: 8
Latest Blog: None
|
One more problem.
Code:
<html>
<head>
</head>
<body>
<center>
<div value="top" style="width:800px; background-color:red;">
1
</div>
<div value="midbar" style="width:800px; background-color:orange;">
2
</div>
<div value="leftmenu" style="width:100px; float:left; background-color:yellow;">
3
</div>
<div value="content" style="width:600px; float:left; background-color:green;">
4
</div>
<div value="rightmenu" style="width:100px; float:left; background-color:blue;">
5
</div>
<div value="empty" style="clear:both;">
</div>
<div value="bottom" style="width:800px; background-color:red; background-color:purple;">
6
</div>
</center>
</body>
</html>
How would I go about making 3,4, and 5 centered like the rest of them? Ignore the values, its for later use.
|
|
|
08-09-2006, 08:40 AM
|
#17 (permalink)
|
|
Empress™
Join Date: 08-19-04
Location: York, UK
Posts: 18,004
|
centered? I'm not sure what you mean in this case. Horizontally...? Vertically? Text-align?
And also, from the get go, you should be trying to use an external stylesheet. Give your divs a class (for multiple instances) or an id (for a single instance) and organize your css that way. It will save you oodles of time in the end.
|
|
|
08-09-2006, 08:43 AM
|
#18 (permalink)
|
|
Inactive
Join Date: 05-01-06
Posts: 166
Latest Blog: None
|
As the structure of the table in html is much longer than the method of using div's you shall also be penilised by search engines such as google, as there spiders only read a certain amount of lines of code 
|
|
|
08-09-2006, 08:44 AM
|
#19 (permalink)
|
|
Inactive
Join Date: 08-08-06
Posts: 8
Latest Blog: None
|
I planned on doing that after I figured out how to do it, copy past that into notepad and save it as html and view it. Numbers 1, 2, and 6 are center horizontally, but since i used float:left; it moves 3,4, and 5 to the left side of the page.
|
|
|
08-09-2006, 08:47 AM
|
#20 (permalink)
|
|
Empress™
Join Date: 08-19-04
Location: York, UK
Posts: 18,004
|
Look at your width values. They are too large. They get knocked to the left because there is no room for them.
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Similar Threads
|
| Thread |
Thread | |