| 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... |
|
|
Josh_rakoons United Kingdom. April 30 2012 21:45. Posts 1157 | Profile # |
| My guess is that they're easier to use for new designers. Last edit: 2012-04-30 21:48:41 |
|
|
| IAMFAPMAN April 30 2012 22:00. Posts 42 | Profile # | |
|
|
| 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... |
|
|
| 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. |
|
|
| 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. |
|
|
| a176 Canada. May 01 2012 00:01. Posts 5431 | Profile Blog # |
On April 30 2012 22:01 Aelfric wrote: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. |
| |
|
| 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. |
|
|
| 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. |
| |
|
| 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/ |
|
|
| 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. |
|

|
| teknotrance May 01 2012 00:34. Posts 61 | Profile # | |
|
|
| Aelfric Turkey. May 01 2012 00:40. Posts 882 | Profile Blog # | |
| | Tomorrow never comes until its too late... |
|
|
| 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... |
|
|
| 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. |
|
|
| 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'; } |
|
|
| Fateless United States. May 01 2012 02:53. Posts 98 | Profile # |
On May 01 2012 00:41 Aelfric wrote: Show nested quote +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.
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: GrammarLast edit: 2012-05-01 02:59:50 |
|

|
| 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. |
|
|
| 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. |
|
|
| 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. |
|
|
| 1 2 Next All |
|