[WCS EU] Season 1 Finals -…
[SPL] Round 5 Week 3 Revie…
[GSTL] Week 10 - Prime Tim…
[WCS KR] Innovation vs. Sy…
[WCS AM] Ro16 Group D Prev…
TL Site Changes
[WCS EU] Grubby, MMA, Ret …
Pizza: All Tiers Reached
Vici and RisingStars Advan…
Up&Down groups for 2013 WC…
HerO, Revival Interviews -…
[SPL] Round 5 Week 4 Start…
Get 50% off Papa John's pi…
TL Advertising Features
Korean Music Discussion
[TV] Sherlock - BBC
GeoGuessr geography game
[TV] Dexter
Men's Fashion Thread
TL Site Changes
Team Liquid Greasemonkey S…
San Francisco, CA | Major …
The Automated Ban List
Barcraft DF - WCS Europe F…
Acer | MMA Fanclub
The Liquid`HerO Fanclub!
Calyso's Stream Thread!
[Stream] Mikezilla
Razer Blackwidow no longer…
Computer Build Resource Th…
Getting a new Mouse! Any R…
Simple Questions Simple An…
[G] Streaming with OBS (Op…
[SPL] Round 5 Week 4 Sta…
Still no location for GS…
Blizzard to Align Ladder…
DeParture, JREcco + more…
SC2 General Discussion &…
Pizza: All Tiers Reached
[WCS EU] Finals Day 1 Prem…
FREE 64 Player Knockout: S…
Win Team Branded T-shirts!…
[Code S] Ro4 Day 2 WCS Kor…
SabrePC Starcraft 2 Invita…
The HotS Zerg Help Me Thread
Practice Partners Thread S…
[Q] Is Mech weaker then bi…
The HotS Protoss Help Me T…
[G] TheCore - Advanced Key…
[A] Starbow
StarCraft: Subjection
[M] (2) ESV Deep Forest
[A] Irongate diaries (offi…
Simple Questions/Answers
General Discussion
Invites and Qualifiers f…
Dota 2 QQ thread
TL's Item Trading Thread.
All Pick - Wong Hock Chuan
DotA 2 Team Recruitment …
[G-1] LAN Finals
[The International] Easter…
Starladder Season 6
[EU] GAMEFACE Launch Event…
Dota 2 Canada Cup - Featur…
Newly ported Hero discussi…
Simple Questions, Simple A…
[G] In-Game Dota Guide for…
[G] Clockwerk, The Offlani…
[H] Night Stalker
My Review of the Starcra…
DES Sonic Interview 5/18…
TeamLiquid Legacy Starle…
[Update] itemBay SSL Gra…
[D] New BW Server
[SOSPA] Event Matches
D Ranks Teamleague Season 4
Gambit's Cup Season 3 Roun…
Gem League II
[GC S3] Gambit's Cup Semif…
C Ranks Teamleague Season 1
Simple Questions, Simple A…
Increasing APM/EAPM
Practice Partner Thread
Challenger map on Starcraf…
NBA Playoffs 2013
Magic: The Gathering Onl…
FINALLY! - The 2013 NHL …
Touhou Discussion Thread
Wildstar MMO
Carnival Cruise Mafia
[T] Bastard "Mini" Mafia!
[M][N] Les Mafia
Questions & Answers
Running Thread
The Injuries Thread
Leta - Movie
Michael - skyline
Anytime - Beast
By.Hero - Shuttle
Anytime - Pusan
Customize Sidebar...

Website Feedback

Closed Threads


IRC Web Chat

TeamSpeak 3 (77 users)


Active: 5785 users

HTML/CSS Tables vs Divs

Forum Index > Tech Support 1 2 All
 
 Aelfric   Turkey. April 30 2012 21:43. Posts 882
Profile Blog # 
Hey guys, i am learning html and designing basic websites and stuff. What i found out via using firebug is most websites use tables for design instead of divs. I always liked to work with divs.

Why do people prefer tables over divs? I always find divs to be more easy. Most documents i found in the internet says divs are more accurate for design. So what i wanted to ask is if you design with tables what are the logical reasons behind it instead of "i am just used to work with it" ?

Poll: Which one is better overall?

Divs + CSS (37)
 
90%

Tables (4)
 
10%

41 total votes

Your vote: Which one is better overall?

(Vote): Tables
(Vote): Divs + CSS



Here is a nice article about this:
http://coding.smashingmagazine.com/2009/04/08/from-table-hell-to-div-hell/
Last edit: 2012-05-01 00:40:04
Tomorrow never comes until its too late...
Old Post

  Josh_rakoons   United Kingdom. April 30 2012 21:45. Posts 1157Profile # 
My guess is that they're easier to use for new designers.
Last edit: 2012-04-30 21:48:41
Old Post

 
 IAMFAPMAN   April 30 2012 22:00. Posts 42
Profile # 
divs > tables imo
Old Post

 
 Aelfric   Turkey. April 30 2012 22:01. Posts 882
Profile Blog # 

On April 30 2012 22:00 IAMFAPMAN wrote:
divs > tables imo

Yeah but i ask why do you think that way.
Tomorrow never comes until its too late...
Old Post

 
 IAMFAPMAN   April 30 2012 22:06. Posts 42
Profile # 
i think the code is alot easier to read.. never used alot of tables tho

.. and im doing this in my freetime so i learnt everything from the internet or books.
Old Post

 
 peol   Sweden. April 30 2012 22:24. Posts 1
Profile # 
Tables are a 90's/early 2000 phenomenon. Last several years it has been known and enforced to write semantic mark-up. Tables are to be used for tabular data, not for layout purposes. I do however think that they may serve a purpose in specific cases (like forms etc.) but generally, seeing tables used for layout is indicating that the developer may not have known what they're doing.

So, use <div>, <section>, <article>, <header>, <footer> etc. (all valid in HTML5, which is widely adopted in any modern web browser) to avoid divitis.
Old Post

 
 a176   Canada. May 01 2012 00:01. Posts 5431
Profile Blog # 

On April 30 2012 22:01 Aelfric wrote:

Show nested quote +


Yeah but i ask why do you think that way.


you dont really need to use tables for overall formatting of webpages anymore. divs + stylesheets offers you a bit more freedom in placement of your content, and its overall much cleaner in the code. save tables for truly tabulated data.
starleague forever
Old Post

 
 Alvin853   Germany. May 01 2012 00:04. Posts 149
Profile # 
From my experience positioning elements with divs tends to be more browser-dependent than using tables. Different browsers or resolutions can cause divs to look different than you want them to, so most websites use tables for the basic layout, and divs for anything that goes on top of that.
Both have their advantages, but I usually prefer tables for anything i need to place at an exact position, for example a table column is much easier to center on a page by adding blind columns left and right, than a div; and I use divs, when I want to place something dynamically like hover-boxes, dropdown menus or anything I don't know right away where to put it.
Old Post

 
 ShoCkeyy   May 01 2012 00:08. Posts 3408
Profile Blog # 
Divs are just easier and faster way of working in the development world. They're also a lot cleaner since you use the CSS to style everything.
Life?
Old Post

 
 Zerste   United States. May 01 2012 00:21. Posts 105
Profile # 
Tables were used before CSS really developed/took off. If you're still using them for anything but tabular data your code is likely invalid. Use the w3c validation services to be sure you're coding up to standards.

http://validator.w3.org/
Old Post

 
 Fateless   United States. May 01 2012 00:27. Posts 98
Profile # 
This is a silly question, and an apples to oranges comparison to be honest. A lot of you are showing your lack of experience through your answers. Also, it makes me laugh that you say you are just learning but that "You always liked divs" What, so you've been doing this for a month and you've already got an established preference?

Tables are not a "90's phenomenon" I would challenge you to find a major modernized website that doesn't contain at least one table, Google, TeamLiquid, and Amazon.com all use at least one table somewhere on their pages. To be a competent developer you need to understand both and learn to apply them seamlessly.

I think you've got the right idea dissecting pages with Firebug but I feel like you're searching for some absolute technique that doesn't exist. Just keep practising and eventually you're going to get a feel for how things should be put together.

TL;DR, There is no hard and fast rule that says when you should use a table or a Div, you're just going to have to gain some experience to learn when to use which.
Old Post

 
 teknotrance   May 01 2012 00:34. Posts 61
Profile # 
where is the article?
Old Post

 
 Aelfric   Turkey. May 01 2012 00:40. Posts 882
Profile Blog # 

On May 01 2012 00:34 teknotrance wrote:
where is the article?

http://coding.smashingmagazine.com/2009/04/08/from-table-hell-to-div-hell/
Tomorrow never comes until its too late...
Old Post

 
 Aelfric   Turkey. May 01 2012 00:41. Posts 882
Profile Blog # 

On May 01 2012 00:27 Fateless wrote:
This is a silly question, and an apples to oranges comparison to be honest. A lot of you are showing your lack of experience through your answers. Also, it makes me laugh that you say you are just learning but that "You always liked divs" What, so you've been doing this for a month and you've already got an established preference?


Yes, so far i liked divs more.
Tomorrow never comes until its too late...
Old Post

 
 wo1fwood   United States. May 01 2012 01:17. Posts 2271
Profile Blog # 
As a good design practice, tables should not be used to define structural elements that are not tabular in nature, simple as that. There are a whole host of really good reasons why, the main two being that A. using tables creates a larger html footprint and therefore cause larger document sizes and slower load times (and becomes very expensive if your site gets a lot of traffic, like Google), and B. thanks to html + CSS we have a way to be more flexible with how we structure our layout.

I don't think anyone who's a designer is saying that tables shouldn't be used, we're saying tables should be used for what they were intended to do, present tabular data.
Old Post

 
 Chargelot   May 01 2012 02:11. Posts 2274
Profile Blog # 
Is it wrong to put your tables inside of divs?
^new to CSS/HTML, genuine question.
Last edit: 2012-05-01 02:13:09
if (post == "stupid") { document.getElementById('post').style.display = 'none'; }
Old Post

 
 Fateless   United States. May 01 2012 02:53. Posts 98
Profile # 

On May 01 2012 00:41 Aelfric wrote:

Show nested quote +


Yes, so far i liked divs more.


Well the problem is just that you have a fundamental misunderstanding of how to use the tools you're talking about. I would try to stop thinking about CSS positioning and tables as having the same purpose; they do not.

When you get into dynamically outputting content you're going to find a lot of situations where tables save you time and produce more consistent results with more compact code that is easier to read. You may then want to apply CSS classes directly to those tables. Even the most pure CSS layout is probably using a <ul> or two. CSS and HTML work together, and tables are just one example of a tag you can apply CSS classes too. It does suck to overuse tables though. You want to make sure you aren't doing things like nesting tables to create a monster layout that would be much simpler with three lists and Float - Clear.

Don't develop a bias towards one tag or method, that kind of thinking is only going to hold you back. As you get more experienced and learn how and when to use code, you will be thankful for every tool you can get your hands on.

Edit: Grammar
Last edit: 2012-05-01 02:59:50
Old Post

 
 Fateless   United States. May 01 2012 03:01. Posts 98
Profile # 

On May 01 2012 02:11 Chargelot wrote:
Is it wrong to put your tables inside of divs?
^new to CSS/HTML, genuine question.



Yes, and no.

Again, there's no hard and fast rule. In many situations you would want to be using classes and apply the class directly to the table.

It depends on the situation though, you might wrap your whole layout in a single div tag with a class applied to constrain the page or set margins.
Old Post

 
 pQylling   Denmark. May 01 2012 03:52. Posts 138
Profile Blog # 
From my own experience I can say that minimal use of tables is the best use of tables. They make everything harder and CSS was basically invented to get rid of table dependant design, among other factors of course. There are situations when tables are the best option, but they shouldn't be overused.
Old Post

 
 sapht   Sweden. May 01 2012 04:23. Posts 141
Profile Blog # 
Use tables for tables.

Use blocks/divs for layout.

They're not opposed. Tables are also useful for very detailed and structured groupings of elements, such as the icons atop this reply field.

Oh and I practically never use them because I hate typing too much and I do very little front-end work, so nobody expects my stuff to look pretty.
Last edit: 2012-05-01 04:27:22
You can use control groups to train units without even looking at your base.
Old Post

1 2 All
Please log in or register to reply.
 

» Recent SC2 Results
» Premier SC2 Tournaments

The Little App Factory