Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Table-Based Layout vs Div-Based Layout [duplicate]

Tags:

html

css

Possible Duplicate:
Why not use tables for layout in HTML?

I just want to know the difference between table-based layout and div-based layout. When should I use what and why?

Thanks in advance.

like image 834
Amira Elsayed Ismail Avatar asked Mar 21 '26 04:03

Amira Elsayed Ismail


1 Answers

Tables should only ever be used for tabular data. It really is as simple as that.

As for why; a website layout isn't tabular data.

Also, a table will use more code in your page. For example; to create one 'box' you can either do this:

<table>
  <tr>
    <td>Box Content</td>
  </tr>
</table>

or this

<div>
  Box Content
</div>

Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!