andykeating started this topic @ 05:40 on 12/01/2011
RE: What is better to use "div" or "tables"?
DLWhitehouse | 12/01/2011 10:31 AM
Using divs is definitely the better and sensible method of creating a website. This is an unarguable fact amongst the web design community.
Tables is a 90's way of developing websites that makes it easy for people who dont really know what they are doing, it was originally used to layout a website in a block methods when html was first introduced (as it was the only way at the time)
I am not sure how much or little you know so I will try to explain the reasons but keep it relatively tech free..(so sorry if I under estimate your knowledge)
Divs uses a method called CSS (cascading style sheets). This means that the key part of the code that tells the website what to put and where (the layout) is held in a seperate file i.e style.css and the web page content like images and text and html are in the other file index.html
The benefit is that it seriously reduces the amount of code that a browser reads through, increasing search engine optimisation and load time. Also that if you want to change, say the background colour of the site. You can do this by changing one thing in the .css file.. rather than multiple times in every single .html file as in the old method.
It also has many other benefits meaning the divs can be lay out in a more flexible manor than using tables, its future proof (so you can change the design layout at any time without re doing all the content) also works nicely across multiple browser platforms and more.
Although this this does not mean you should have a fear of tables entirely, they are still useful when an actual table is needed within the design, like a price list or spec sheet etc. For their original purpose.
Hope that helps, and more questions on the subject fire away 
------------------------
www.inlifedesign.com - creative web design, development & marketing
RE: What is better to use "div" or "tables"?
totalwise | 31/01/2011 08:12 PM
I learn html in 2000, when tables were the norm. I have to say though divs are very difficult to get my had round, mainly because the external stylesheets foce you to look back and forth between several pages.
But it's wwise to learn to use how to use divs if you want to futureproof your learning, tables are good for presenting data in a spreadsheet style table. But not good for much else.
------------------------
Industrial tablet PC
RE: What is better to use "div" or "tables"?
AstarothSolutions | 04/02/2011 12:51 PM
They are both correct, but they are for different things....
Tables are for exactly what you use a table for in a Word document or a presentation, they are used for containing tabular data.
Divs are divisions or blocks of information (think of a textbox in a Power Point presentation)
With both of these you can use CSS (cascading style sheets) to style their appearance, interaction etc as well as that of its content.
There is a lot of history connected to the useage of both and in that history you will find the reasons why things were done the way they were done.
In a purists view point the Content and Style should be held seperately from each other (just as in programming business logic shouldn't be mixed up in functionality) thus in the future if you want to change the Style you don't need to interfer with the Content and visa versa.
On this basis a div should be used to block together content and then CSS used to define where it is and what it looks like etc. A table will hold tabular data and will reside within a div with CSS posititioning the div and styling the table and its content.
Now moving away from the purists view point to the practical, a very complex layout can be achieved with very few lines of HTML when using divs as the CSS deals with the layout issues. Use tables to do the layout and you get a mountain of HTML as your trying to define layout with it rather than CSS.
A mountain of complex HTML creates 2 problems, firstly it is much more difficult to maintain and update in the future. Secondly from a Search Engine perspective it has a much more difficult time identifying your content from the code and thus typically your site will rank lower than if it had been created with clean minimalistic coding.
------------------------
www.AstarothSolutions.com - Bespoke web development
Do you need more hours in a day? http://www.VirtualAssistantDirect.com
RE: RE: What is better to use "div" or "tables"?
cliffdodger | 05/02/2011 12:30 AM
+1 on this.
I do as much as I can in DIV tags so that the CSS can keep things looking consistent across the site, but when it comes to getting PHP results into a manageable format, I'm a table monkey through and through.. (The CSS is still handling color and font, just not position)
------------------------
Reduce, reuse, recycle your old fax machine in favor of an internet fax service.
RE: What is better to use "div" or "tables"?
lisaroy1 | 08/02/2011 09:58 AM
"Div" is much better than "Tables" as it will create a light weight and seo friendly webpage but there are some browser compatibility issues with "Div" which can be handled easily if the website is a Static website, whereas in Dynamic websites "Tables" always dominate on "Div" as the compatibility issues become less and dynamic data can be easily handled in "table" rather than "div"...
RE: What is better to use "div" or "tables"?
AstarothSolutions | 08/02/2011 01:57 PM
Definitely the exact opposite, dynamicly driven pages are much more easily controlled through divs than tables as all elements are independant.
If you had a table doing your structure with the classic image based L layout - header and left hand navigation a continuous looking structure. Row 8 for example on the left holds a navigation item which is an image and in one of the middle colums is to hold the total value of an order. In normal circumstances this works fine as it would in a div. Lets suppose however that the user has poor eyesight and so enlarges the font or they order a lot of items and cause the price to be too large to fit in the cell and so you get wrapping.
This row is now double the size it should be and that goes across the whole screen, therefore the navigation column on the left now looks broken as the image is too small for the double height row.
With a Div on the other hand, if styled correctly, all continue to sit exactly where they should be with the other items in the centre section simply moving down to deal with the larger price line.
------------------------
www.AstarothSolutions.com - Bespoke web development
Do you need more hours in a day? http://www.VirtualAssistantDirect.com
RE: What is better to use "div" or "tables"?
needtoknow | 08/02/2011 07:10 PM
Building a web page with div tags and using stylesheets (CSS) to create a layout means more of the web page is content and less is the markup language (HTML) which gives the page it's look. This means the web page downloaded by the browser is smaller in size making it quicker to load in a web browser. Google is including the speed at which web pages from your site take to load as part of its ranking process for a site, slower bulkier sites loosing ranking score compared to the same faster loading page.
However, if you actually need to show a table of data within your web page, then using the table tags is much easier than trying to re-invent the wheel with styled div tags.