HTML layout - Help with good and bad practices

This is a discussion on "HTML layout - Help with good and bad practices" within the Web Page Design section. This forum, and the thread "HTML layout - Help with good and bad practices are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jul 10th, 2007, 12:37
Up'n'Coming Member
Join Date: Jul 2007
Location: England
Posts: 67
Blog Entries: 5
Thanks: 0
Thanked 0 Times in 0 Posts
HTML layout - Help with good and bad practices

Hi there,

Just got a quick question regarding good methods and bad regarding layouts.

Im a tables and CSS man myself, but I'm wondering how bad my practices are, ie are they suitable or not.

For me, its what ever gets the job done, but im concerned I might be setting myself up for bad habbits, being self taught and all.

The way I normally develop an HTML page / template is using tables.

I usually start with a single table with a single row and no colums and set that to 100% width to get my area. All are border 0 and usually cellpad and cellspace set to between 2 and 5 depending on the design.

Also depending on the design, I usually add another table inside that probably one row and two colums, and if I need to I can add a table inside one of those colums, when I have my layout and functions in place, I normally concentrate on my colors and grafix but sometimes mock some up before hand or as needed as visual place holders / notes.

Im concerned that all these tables inside tables is a bad habbit, especially when a lot of html sites / templates now days are done using css and the div tag.
I dont have a clue about working with DIV and css only.

So, am I full of bad habbits or is my way acceptable?

Cheers
Last Blog Entry: Fire In The Hole! (Jan 23rd, 2008)
Reply With Quote

  #2 (permalink)  
Old Jul 10th, 2007, 12:45
SuperMember

SuperMember
Join Date: Apr 2007
Location: Ireland
Age: 15
Posts: 332
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Pádraig
Re: HTML layout - Help with good and bad practices

I think that using tables is kind of a selfish thing to do, as it is bad for screen readers and its just plain wrong aswell!

Usings DIVs (<div>'s) and CSS is the correct way to build a site.

Take the time to learn (X)HTML and CSS. Its worth it!
Reply With Quote
  #3 (permalink)  
Old Jul 10th, 2007, 12:47
SuperMember

SuperMember
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: HTML layout - Help with good and bad practices

Full of bad habits, I'm afraid

It's not easy to become proficient in using CSS for layouts. Once you've invested the time for learning, however, you will surely prefer CSS layouts to table layouts.

Table layouts were a brilliant hack for the 90's, but their time has passed.

Be warned, though: complex layouts in CSS are not easy, and sometimes impossible. Then again, why would you want a complex layout?

If only Internet Explorer supported display: table-cell

Last edited by MikeHopley; Jul 10th, 2007 at 12:50.
Reply With Quote
  #4 (permalink)  
Old Jul 10th, 2007, 12:52
Up'n'Coming Member
Join Date: Jul 2007
Location: England
Posts: 67
Blog Entries: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: HTML layout - Help with good and bad practices

I have an idea that <div> layouts are controled in majority by margin and padding etc, is this correct?
I always knew tables were "cheating" because of their ease of use, but I deffinately prefer the control you get with CSS.

I will certainly look into xhtml further. I want to start moving towards compliance with the latest ways of doing things.

I can see why things progressed to css & divs beacuse it gives you total site wide control from one or two little css files.
Last Blog Entry: Fire In The Hole! (Jan 23rd, 2008)
Reply With Quote
  #5 (permalink)  
Old Jul 10th, 2007, 13:00
SuperMember

SuperMember
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: HTML layout - Help with good and bad practices

Quote:
Originally Posted by weasel View Post
I have an idea that <div> layouts are controled in majority by margin and padding etc, is this correct?
That's right

Other useful properties include: width, max-width, float, and position. Some of these are pretty complex, but they allow you powerful control of your page layout if used properly.
Reply With Quote
  #6 (permalink)  
Old Jul 10th, 2007, 13:03
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: HTML layout - Help with good and bad practices

I have an article coming out in the August Newsletter that lays out the benefits to hand coding versus the way you are doing things.

But you'll have to wait!!!
Reply With Quote
  #7 (permalink)  
Old Jul 10th, 2007, 13:14
Up'n'Coming Member
Join Date: Jul 2007
Location: England
Posts: 67
Blog Entries: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: HTML layout - Help with good and bad practices

Sounds just like what I need... cant wait!!!
I can feel some one or two page experiments coming on lol

The tables are strong but I must resist... heheheh

I knew I loved css for a reason when I found it.
I quite often forget all the css and html commands so I got a nice bookmark folder full of sites with refereces to what does what. If I ever need something a little more complex like text appear on mouse over image, I usually use google which has proved quite usefull.

It's like a library or the world in one little box lol
Last Blog Entry: Fire In The Hole! (Jan 23rd, 2008)
Reply With Quote
  #8 (permalink)  
Old Jul 10th, 2007, 13:17
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: HTML layout - Help with good and bad practices

See the stickied post or the link in my sig. Mucho goodies in that thread
Reply With Quote
  #9 (permalink)  
Old Jul 10th, 2007, 13:21
Up'n'Coming Member
Join Date: Jul 2007
Location: England
Posts: 67
Blog Entries: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: HTML layout - Help with good and bad practices

One word....
WOW

Thanks for those resources, they look like just the thing I need to get started

Thanks again!!!
Last Blog Entry: Fire In The Hole! (Jan 23rd, 2008)
Reply With Quote
  #10 (permalink)  
Old Jul 10th, 2007, 15:07
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: HTML layout - Help with good and bad practices

weasel, I was a table addict too! I'd come back here and say "Are you sure about the benefits to hand coding"! I even asked the question once in my frustration.. how come ebay uses tables and I can't!

I was so slow... so unprofitable.. but honestly within no time at all, I was understanding it and I was HOOKED! Everyday I learn something new and still love it.
Reply With Quote
  #11 (permalink)  
Old Jul 10th, 2007, 15:08
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: HTML layout - Help with good and bad practices

I remember that addiction of yours
Reply With Quote
  #12 (permalink)  
Old Jul 10th, 2007, 15:11
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: HTML layout - Help with good and bad practices

Yup... Karinne gave me my first lbig push away from Tables.
:blush-anim-cl:
Reply With Quote
  #13 (permalink)  
Old Jul 10th, 2007, 15:18
SuperMember

SuperMember
Join Date: May 2006
Location: North West, UK
Age: 21
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: HTML layout - Help with good and bad practices

Not just tables but nested tables! I nearly had a heart attack but luckily you are on the road to web standards heaven (though it can be a bit tricky sometimes). As Mike said some stuff can be quite complex but I would say that most things are doable and I would imagine anything you are doing now is possible with css, at a guess.

Those links that karinne has put up are amongst the best resources on the net (which is why she put them up, I imagine) and you won't go far wrong with them.

Pete.
Reply With Quote
  #14 (permalink)  
Old Jul 10th, 2007, 16:53
Up'n'Coming Member
Join Date: Jul 2007
Location: England
Posts: 67
Blog Entries: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: HTML layout - Help with good and bad practices

Cheers guys for all the great responses and encouragement.

EDIT// nested tables? One inside another?

I am following one or two of the recomended tutorials now which I hope will help me better understand how to align and marginalise using css.
I am trying to get a simple header followed by a left colum and a right larger colum for content finsihed off with a footer, but
I seem to be getting into a bit of a pickle with my left nav forcing my right side content down with it lol

I refuse to give up cos I know once it clicks in my head and I figure it out I will feel like a right plum if it beats me lol
Last Blog Entry: Fire In The Hole! (Jan 23rd, 2008)

Last edited by weasel; Jul 10th, 2007 at 16:58.
Reply With Quote
  #15 (permalink)  
Old Jul 10th, 2007, 16:55
moojoo's Avatar
Moderator
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,742
Blog Entries: 1
Thanks: 0
Thanked 17 Times in 17 Posts
Send a message via AIM to moojoo Send a message via MSN to moojoo Send a message via Yahoo to moojoo
Re: HTML layout - Help with good and bad practices

Tables are good for eating on. Man oh man am I fancy! woooo! At any rate CSS/XHTML Strict imo is the best way to go. In time you will find yourself getting the same results with far less code and then you can change your whole layout etc just by editing a single style sheet! It pretty much rocks.
__________________
The internet is just a fad.
http://www.mevans76.com
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Reply With Quote
  #16 (permalink)  
Old Jul 10th, 2007, 17:05
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: HTML layout - Help with good and bad practices

Quote:
Originally Posted by weasel View Post
I am following one or two of the recomended tutorials now which I hope will help me better understand how to align and marginalise using css.
I am trying to get a simple header followed by a left colum and a right larger colum for content finsihed off with a footer, but
I seem to be getting into a bit of a pickle with my left nav forcing my right side content down with it lol
It has to do with the box model. You need to compensate for and margins or padding or borders you set for every div.
Reply With Quote
  #17 (permalink)  
Old Jul 10th, 2007, 17:13
Up'n'Coming Member
Join Date: Jul 2007
Location: England
Posts: 67
Blog Entries: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: HTML layout - Help with good and bad practices

how would I have a div side by side? ie, like I would if I split a table row into two colums?
Last Blog Entry: Fire In The Hole! (Jan 23rd, 2008)
Reply With Quote
  #18 (permalink)  
Old Jul 10th, 2007, 17:15
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: HTML layout - Help with good and bad practices

setting a width to each div and setting them to float: left (or right).

The examples in the thread I sent you too, should have this.
Reply With Quote
  #19 (permalink)  
Old Jul 10th, 2007, 17:55
Up'n'Coming Member
Join Date: Jul 2007
Location: France
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
Re: HTML layout - Help with good and bad practices

Tables are for tabular data, and falling under after too much wine...

The way to go is CSS (and PHP). There are plenty of tutorials out there, and endless free templates you can pull apart and examine.

Welcome to the 21st Century!
Reply With Quote
  #20 (permalink)  
Old Jul 10th, 2007, 18:01
Up'n'Coming Member
Join Date: Jul 2007
Location: England
Posts: 67
Blog Entries: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: HTML layout - Help with good and bad practices

well thats really annoying... IE spoils the lot. Lovely in FF horrible in IE... why does IE suck so badly....

Here is what I have so far,

HTML
Code: Select all
<body>
<div id="header">Header</div>
<div id="left">Left</div>
<div id="content">Content</div>
<div id="footer">FOOTER</div>
</body>
CSS
Code: Select all
body {
margin-left:100px;
margin-right:100px;
margin-top:50px;
padding:0;
height:100%;
background:#ffffff;
font-family:"verdana",arial;
font-size:12px;
color:#ff0000;
}


#header{
padding: 10px 10px 10px 10px;
height:100px;
background-color:#999999;
}

#left{
position:absolute;
padding:10px 10px 10px 10px;
background-color:#cccccc;
float:left;
width:200px;
}
#content{
padding:10px 10px 10px 10px;
background-color:#333333;
float:right;
width:750px;
}

#footer{
padding:10px 10px 10px 10px;
height:100px;
width:780px;
background-color:#006600;
font-family:inherit;
color:#ff0000;
}
But the footer is too short in IE but just right in FF.
Also the padding I set for the footer isnt applying in IE or FF
Last Blog Entry: Fire In The Hole! (Jan 23rd, 2008)
Reply With Quote
Reply

Tags
layout, html, good, css, bad, practices

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Good Resource for those who write HTML tutorials. Jack Franklin Webforumz Cafe 12 Oct 2nd, 2007 14:27
Need good HTML template service... pdbuddy Starting Out 4 Apr 7th, 2007 20:48
Encrypt HTML ~ GOOD software recommendations mr_faster Web Page Design 4 Jul 25th, 2006 11:41
What makes a layout a good layout? Miles Lombardi Graphics and 3D 4 Jul 26th, 2005 03:22


All times are GMT. The time now is 10:33.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

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