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.


 Subscribe in a reader

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

Notices




Reply
 
LinkBack Thread Tools
  #1  
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)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jul 10th, 2007, 12:45
Reputable Member
Join Date: Apr 2007
Location: Ireland
Age: 15
Posts: 332
Thanks: 0
Thanked 0 Times in 0 Posts
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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jul 10th, 2007, 12:47
Most Reputable Member
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
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)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Jul 10th, 2007, 13:00
Most Reputable Member
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Jul 10th, 2007, 13:03
Elite Veteran
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!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
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)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Jul 10th, 2007, 13:17
Elite Veteran
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
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)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Jul 10th, 2007, 15:07
Elite Veteran
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Jul 10th, 2007, 15:08
Elite Veteran
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old Jul 10th, 2007, 15:11
Elite Veteran
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:
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #13  
Old Jul 10th, 2007, 15:18
Most Reputable Member
Join Date: May 2006
Location: North West, UK
Age: 22
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #14  
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #15  
Old Jul 10th, 2007, 16:55
Elite Veteran
Join Date: Aug 2005
Location: That Place
Posts: 2,044
Blog Entries: 1
Thanks: 0
Thanked 37 Times in 37 Posts
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.
__________________

Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #16  
Old Jul 10th, 2007, 17:05
Elite Veteran
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #17  
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)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #18  
Old Jul 10th, 2007, 17:15
Elite Veteran
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote