PDA

View Full Version : What is better to use "div" or "tables"?



andykeating
01-13-2011, 09:40 AM
Hi all,
I would like to know some doubts that I have. I have observer that some websites are using "div" and other "tables".
What is the difference between those 2? What do I get or what results, if I use "div" or "tables" in my website.
I would like to hear some professional opinions.
Thanks a lot to all,:idunno::idunno:

tesco
01-15-2011, 06:37 PM
Depends on what you are trying to do.
Tables are good for, well, tables (of data). For example this was a perfect candidate for a table: http://filesharingtalk.com/what-trackers-offer/

A "div" is just a container element, like "span", the difference between the two being that div is a block element and span is an inline element. They can each be changed to the opposite by using display: block; or display: inline-block; in your CSS.

For creating a site layout of header, columns, data in the middle, and a footer, the proper method would be to use div, span, etc. combined with CSS to get your layout.
Though tables are a much easier method for newbies, because you don't need to learn CSS or do any calculating or tinkering, it just works, at the expense of bloated and convoluted code.

sandman_1
01-16-2011, 07:35 PM
LOL when I read the header, I thought ohh an assembler question, great! :D

anon
01-16-2011, 08:48 PM
As for me, I'm pretty surprised the first two posters haven't appended a fake signature to their messages, or have ad links on their profile page. :lol:

GreenTea
01-17-2011, 11:19 AM
div is divinitely better for layouts. and tables, for tabular data.

janovein
01-30-2011, 10:04 PM
Use the <table> element to create complex page designs, often using graphics to create looks that could not be done with the very limited HTML of the day ( no CSS, barely any formatting possibilities ). Unfortunately, the 'table' element was never really meant to fulfill this duty, but was supposed to contain data, like from a database.
Nevertheless, the web steamed on using primarily tables to construct all web pages, much to the chagrin of the W3C, the World Wide Web standars body. They quickly realized that the design of the page had to be taken into account, and so began to try to undo the damage that had been done already. The solution?—CSS 1 ( Cascading Style Sheets ), and some new HTML tags, <div> being most important. Div, when styled with CSS, was developed to allow designers unprecedented control of the layout of a webpage.

jalicia18
01-31-2011, 07:26 AM
I prefer div for my web layout.. to get fast indexed in SE.

mr-mr
02-05-2011, 01:26 PM
Div + CSS > Table. It's way more flexible.

bijoy
02-06-2011, 03:37 PM
Div + CSS > Table. It's way more flexible.

I smily answer: :no:

Daydream
02-06-2011, 03:45 PM
The tableless layout is much more flexible and customizable.
Plus, its more easy to code your design, to arrange the slices of your PSD.
Moreover, the HTML code is more simplified and neat when using divs than using tables.

If you learn more about CSS and HTML coding and try to make some web layouts, you will answer your question by yourself.

hostingguru
02-21-2011, 07:39 AM
Many people try to use table elements and its descendants for page layout, for two reasons. The first is historical: tables have been around longer than CSS. Second, tables offer a quick way to create a grid-based page layout. The prevalence of table-based layouts leads to the main gripe some have against CSS (aside from sketchy support in certain browsers): replacing table-based layout with pure CSS is often seen as a difficult task.

cpul
03-03-2011, 04:41 AM
"Div" more friendly with SEO.
so if you want to look good web design by google.
please use a "div" instead of "table"

brotherdoobie
03-23-2011, 03:11 AM
<div>meh</div>


-doobs

cools4u
04-19-2011, 10:11 AM
For developing Static websites "Div" is the best option. It will create a light weight website easy to download and less code to easily manage ...

Ramesh1
04-28-2011, 10:11 AM
It depends on you which kind of language you are using you can use both also and if you are using CSS than do not use div................

swizZ8
05-09-2011, 09:48 AM
If you are starting with web programming i would recommend using <div> tags and learning css. Of course, u will get a good grasp of HTML in the process.

dentalcare
05-13-2011, 11:05 AM
Div is better than table.

Cooper41
05-16-2011, 07:41 PM
You should use both divs and tables, but not for the same thing. You should use divs combined with css to style your website and you should only use table to display data that actually has to be in a table, unless is a html e-mail where you have to use tables, unless it's a html e-mail where you can't properly style the layout with divs.

inforayssan
06-22-2011, 07:39 AM
well i think that going for table would be more beneficial as it avoids confusion n no need to do all the calculation stuffs.

sbglobal123
07-06-2011, 09:24 AM
Div are better then table.

fook3d
07-12-2011, 12:13 PM
I agree with what has already been said within this post.

DIV's are for layouts, tables are for holding tabular data.

There is no compromise, if you know your way around web design and development, you would never use tables for anything other than holding data. DIV's are the way to go as they look cleaner, heavily customisable and look more professional when people view the code.

Thats my 2 cents at least :)

Scene
09-10-2011, 03:13 PM
I prefer <div> tags. Why? Because with them are more easy to work.

fantasy88
09-14-2011, 11:57 AM
Table is quickly coding than div + css . But it's make website heavier . Div run faster and better in Seo .

dreamgirl
09-16-2011, 07:18 PM
When I see a website made with tables a cringe and have a hard time taking the entire site seriously. It's just so outdated and unnecessary. Divs provide so many more options and are a billion times better.

spitser
09-17-2011, 11:46 AM
:ermm:Div is better than table because Div is flexible than table and in div images are slotted in different module and in table it is not possible.:noes:

brotherdoobie
09-26-2011, 02:33 AM
Frames are where it is at, lads.

:dabs:

-doobs

hdonkey
10-26-2011, 04:17 PM
I prefer div tags, much easier to work with imo

saamarth01
11-24-2011, 11:35 AM
Hye,

I'm not designer, but i have some knowledge about "Div" & "tables"

I think div is better to tables.

narindersingh
03-01-2012, 07:21 AM
Sorry dear i don't have any information about designing .... :(

rushalipatekar
04-30-2012, 11:41 AM
use div avoid table

WearAngels
07-24-2012, 05:35 PM
div syntax was said to be flexible tags in Html compared to table.

flecheradams
05-09-2013, 07:06 AM
The <div> tag defines a division in an HTML document. You can used div element for styling purposes. Mostly use of div element to give a layout of a web page with CSS.