Tables vs Divs

I myself prefer Tables, but most developers prefer Divs.

To me it is easier to get things to go where I want them using Tables

Div's need to be properly coded or they end up who knows where on the page.

The learning time for Tables to me is so much easier.

But using Divs does have its advantages.

Their are different ways to position divs. (Absolute, Relative, and Float)

Below is the css code for a div named navigation that is Absolute Positioned




And here is the div code that goes in the Body of your page



As you can see, you position the div to a specific area of the page.

This can be a good thing, or a bad thing.

Now say you want the next div to go below that div.

In a Table, we would start a New Row < tr >(Simple). In a Div layout. if your a beginner, good luck figuring it out.

Tables are simple < tr > to start a new row,
and < td > to start a new column.

Div's require a lot more learning to understand the many different ways to use them.

I am still trying to learn Div's myself. I have used Div Layouts many times, but always pre-made layouts, and I have difficulty trying to alter the placement of the Divs. If changing number of divs in each row, I have the best luck Absolute Positioning every div, but need a calculator for that. I'm terrible at math. Floating Divs are easy if just 2 columns. Relative Div's totally confuse me.

To me,
Tables are like having Dresser Drawers to put stuff in,
TR for each row of drawers, TD for each drawer in the row,

Div's are like trying to stack stuff without drawers or shelves,
if not stacked correctly, your stuff or div, will fall over.
The easiest to me is a two column, float left, float right, div layout.
If you want 4 (divs) in one row, and 2 (divs) in another row, and 3 (divs) in the next row, it gets difficult. But maybe I just haven't found the right tutorial.

But that doesn't mean you shouldn't try to learn it,
because their are good reasons to use Div's instead of Tables.

If you want to be a pro at building websites, then you would want
to learn how to use Div Layouts.

There are many Div Layout Tutorials online.

Below are a few links explaining Div Layouts:


Working with divs

Div boxes

HTML DIV Tutorial

No comments:

Post a Comment

Leave A Comment