What is better to use "div" or "tables"?
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:
Re: What is better to use "div" or "tables"?
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.
Re: What is better to use "div" or "tables"?
LOL when I read the header, I thought ohh an assembler question, great! :D
Re: What is better to use "div" or "tables"?
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:
Re: What is better to use "div" or "tables"?
div is divinitely better for layouts. and tables, for tabular data.
Re: What is better to use "div" or "tables"?
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.
Re: What is better to use "div" or "tables"?
I prefer div for my web layout.. to get fast indexed in SE.
Re: What is better to use "div" or "tables"?
Div + CSS > Table. It's way more flexible.
Re: What is better to use "div" or "tables"?
Quote:
Originally Posted by
mr-mr
Div + CSS > Table. It's way more flexible.
I smily answer: :no:
Re: What is better to use "div" or "tables"?
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.