Page 1 of 1 [ 14 posts ] 

Madbones
Veteran
Veteran

User avatar

Joined: 7 Mar 2010
Age: 29
Gender: Male
Posts: 777
Location: In the zone

13 Aug 2012, 3:55 pm

Hey!
I was just thinking about how some people use different methods to designs sites. I use HTML tables for layouts because they work well and they are robust. Why is everyone so against it for?
Im probably just the worlds worst web developer, but I dont see why its so bad.
Any ideas?
PS:
It could be my outdated skills.... I might need a bash into the 21st century :lol:
Which is weird because Im too young... I only started programming 4 years ago and web dev 2.


_________________
?Sometimes when you innovate, you make mistakes. It is best to admit them quickly, and get on with improving your other innovations.? -Steve Jobs.


sliqua-jcooter
Veteran
Veteran

User avatar

Joined: 25 Jan 2010
Age: 39
Gender: Male
Posts: 1,488
Location: Burke, Virginia, USA

13 Aug 2012, 4:49 pm

Tables are meant for displaying tabulated data, not for arranging elements on a page. Using them as such is a hack, and is bad form.

Also, since CSS is dramatically more powerful for arranging elements now than tables (especially since CSS introduces the concept of stacked elements with a z-index), you don't have to do stupid hacks like chopping images to fit different images in table cells, etc.


_________________
Nothing posted here should be construed as the opinion or position of my company, or an official position of WrongPlanet in any way, unless specifically mentioned.


betrayedbymyown
Tufted Titmouse
Tufted Titmouse

User avatar

Joined: 10 Jul 2012
Age: 52
Gender: Female
Posts: 47

13 Aug 2012, 9:48 pm

there's nothing wrong with it when it's a hobby. it's a creative way to get the job done when you don't know enough css to do it the proper way. i use tables for layout too, but i think i need a boot into the 21st century as well. i only know basic css, but i think the idea is to encapsulate the layout code into the css file, so that if you need to redesign the layout e.g. for widescreen monitor, phone, tablet, etc, then you just make the change there in your css file instead of having to rearrange your table tags. also, if you've got heaps of pages in your website, and they share the one css file, then this means the layout is consistent throughout the site, automatically, without needing to go into every page to make the same changes in each. however, i have bypassed the need to progress from tables to css, because i use php/mysql to generate a consistent set of pages!



DC
Veteran
Veteran

User avatar

Joined: 15 Aug 2011
Age: 48
Gender: Male
Posts: 1,477

13 Aug 2012, 10:59 pm

Because CSS lets you do this:

http://www.csszengarden.com/

If you are having trouble figuring out what that site is click on a few of the different designs to see how much they differ.

That is done without touching a single line of HTML, the only thing changing is the stylesheet. Who cares? By using CSS properly you can completely separate the content on the site from the design and control the design from a single file.

This makes life a million times easier as your site goes and you need to update it or refresh the look. It also makes life a lot easier for people who need accessibility aids to use your site or people using different devices.



pete1061
Veteran
Veteran

User avatar

Joined: 12 Nov 2011
Age: 56
Gender: Male
Posts: 1,766
Location: Portland, OR

14 Aug 2012, 6:42 pm

Using tables for design might have been ok back in 1998, before css gained a foothold.
I pulled off some pretty complex layouts back in the day using just tables.
But now, css support is pretty much universal and will give you much more control over layout, and many more options.


_________________
Your Aspie score: 172 of 200
Your neurotypical (non-autistic) score: 35 of 200
You are very likely an Aspie
Diagnosed in 2005


Madbones
Veteran
Veteran

User avatar

Joined: 7 Mar 2010
Age: 29
Gender: Male
Posts: 777
Location: In the zone

14 Aug 2012, 6:45 pm

pete1061 wrote:
Using tables for design might have been ok back in 1998, before css gained a foothold.
I pulled off some pretty complex layouts back in the day using just tables.
But now, css support is pretty much universal and will give you much more control over layout, and many more options.

Dont suppose you could give me the alternatives?
Thanks!


_________________
?Sometimes when you innovate, you make mistakes. It is best to admit them quickly, and get on with improving your other innovations.? -Steve Jobs.


betrayedbymyown
Tufted Titmouse
Tufted Titmouse

User avatar

Joined: 10 Jul 2012
Age: 52
Gender: Female
Posts: 47

14 Aug 2012, 6:49 pm

that's what i thought, in my ignorant wisdom! i remember seeing that zen garden years ago, but i never got around to learning it since my websites typically consist of one index.html and one or two php pages. this means my design and content are separated into html and mysql. but certainly a website consisting of many php pages would benefit from css too. however i could just as well encapsulate the table-based layout into php functions if i really wanted to avoid learning css. but i'm sure css is much more elegant.



Madbones
Veteran
Veteran

User avatar

Joined: 7 Mar 2010
Age: 29
Gender: Male
Posts: 777
Location: In the zone

14 Aug 2012, 6:52 pm

I will look at ZenGarden when things are a little less manic/busy as it looks very useful!
I am on holiday soon, so I should have some time to chill and take a look! :D (I do loads of other things on holiday, but what am I supposed to do when its night time? :lol: )


_________________
?Sometimes when you innovate, you make mistakes. It is best to admit them quickly, and get on with improving your other innovations.? -Steve Jobs.


sliqua-jcooter
Veteran
Veteran

User avatar

Joined: 25 Jan 2010
Age: 39
Gender: Male
Posts: 1,488
Location: Burke, Virginia, USA

14 Aug 2012, 8:10 pm

betrayedbymyown wrote:
that's what i thought, in my ignorant wisdom! i remember seeing that zen garden years ago, but i never got around to learning it since my websites typically consist of one index.html and one or two php pages. this means my design and content are separated into html and mysql. but certainly a website consisting of many php pages would benefit from css too. however i could just as well encapsulate the table-based layout into php functions if i really wanted to avoid learning css. but i'm sure css is much more elegant.


The point is not just that it's more elegant - it's dramatically easier to use CSS to come up with a design. Especially when it comes to layering design elements. Rather than trying to composite images into one image that you then slice up to make fit into table cells - you just layer your design elements on top of one another as whole images - and you don't have to worry about the overall layout of your page as elements interact with other elements. I'll never go back to trying to force design elements into tables - not because it's not best practice - but simply because it's dramatically more difficult.


_________________
Nothing posted here should be construed as the opinion or position of my company, or an official position of WrongPlanet in any way, unless specifically mentioned.


monkeykoder
Blue Jay
Blue Jay

User avatar

Joined: 7 Feb 2012
Age: 40
Gender: Male
Posts: 76

15 Aug 2012, 7:19 pm

Code:
<div class="random"></div> <span class="random2"></span>


Add css to the above and you have layout just don't expect me to write the CSS I'm rather talented in the middle tier but UI and Databases make me cringe (actually Databases aren't so bad if managed correctly). The real reason not to use tables for layout is so that anyone reading your code will understand your intentions. Tables are used for displaying inherently tabular data like spreadsheets and database tables.



Madbones
Veteran
Veteran

User avatar

Joined: 7 Mar 2010
Age: 29
Gender: Male
Posts: 777
Location: In the zone

16 Aug 2012, 3:23 pm

Ah nice!
I have just finished a pretty damn big website and I dont really feel up to reprogramming it to be correct as I am using tables for the layout.Do you think it will be ok if I leve it until I feel up to redoing it?
Its a personal website for a game server. It works on all browsers very nicely.


_________________
?Sometimes when you innovate, you make mistakes. It is best to admit them quickly, and get on with improving your other innovations.? -Steve Jobs.


AngelKnight
Veteran
Veteran

User avatar

Joined: 3 May 2011
Age: 49
Gender: Male
Posts: 749
Location: This is not my home; I'm just passing through

16 Aug 2012, 4:07 pm

Madbones wrote:
Ah nice!
I have just finished a pretty damn big website and I dont really feel up to reprogramming it to be correct as I am using tables for the layout.Do you think it will be ok if I leve it until I feel up to redoing it?
Its a personal website for a game server. It works on all browsers very nicely.


If it's a hobby, leave it in whatever shape is comfortable for you and your users.



monkeykoder
Blue Jay
Blue Jay

User avatar

Joined: 7 Feb 2012
Age: 40
Gender: Male
Posts: 76

16 Aug 2012, 8:50 pm

Madbones wrote:
Ah nice!
I have just finished a pretty damn big website and I dont really feel up to reprogramming it to be correct as I am using tables for the layout.Do you think it will be ok if I leve it until I feel up to redoing it?
Its a personal website for a game server. It works on all browsers very nicely.


I have experience with million dollar web applications that use tables for layout I really wouldn't worry about it. It merely makes it easier for other people to read your code.



betrayedbymyown
Tufted Titmouse
Tufted Titmouse

User avatar

Joined: 10 Jul 2012
Age: 52
Gender: Female
Posts: 47

29 Aug 2012, 9:29 pm

oh yes, i've put "learn CSS from zen garden" on my small project list now, i've moved it to the top five, and i currently have it scheduled for the first of september, but that's likely to change.