# Tables vs. CSS positioning



## ct5098 (Jul 28, 2010)

Recently, I started creating websites for friends and family. On all of their sites, I have used tables for positioning all the miscellaneous items on the website. I haven't had any formal schooling on using HTML, CSS, etc. and I am not sure whether I should be using tables or positioning with CSS. Is one method recommended over another?


----------



## W1zzard (Jul 28, 2010)

css positioning is the recommended method. use tables for tabular data only.

personally i use css where it is possible without too much trouble, and tables otherwise.

just be aware that tables block rendering until their html code is fully loaded, so if you make the whole page a table with all content inside your page will not show anything until it's fully loaded


----------



## ct5098 (Jul 28, 2010)

Thanks for the fast reply. So, using CSS makes the page _appear_ to load faster?


----------



## W1zzard (Jul 28, 2010)

css is cleaner

due to how tables are designed they are slower than css though


----------



## ct5098 (Jul 28, 2010)

Thank you for helping me. I was wondering if you could just verify that I was doing the HTML/CSS correctly in positioning elements on the page:


```
<?php
$URL = "http://hortonia.logrit.com/";
$IMAGE = $URL."images/";
$STYLE = $URL."style/style.css";

function drawHead()
{
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
  <HEAD>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="style.css" />
    <TITLE>Lake Hortonia Property Owners Association</TITLE>
  </HEAD>
  <BODY>
    <div><img src="<?php global $URL; echo $URL;?>header.png" alt="Header"/></div>
<?php
}
function drawFoot()
{
?>
  </BODY>
</HTML>
<?php
}
?>
```

and the stylesheet:


```
body
{
  background-color:white;
}
div
{
  width:1024px;
  margin-left:auto;
  margin-right:auto;
  display:block;
}
```


----------



## FordGT90Concept (Jul 28, 2010)

I prefer tables.  They tend to render without issues across most browsers.


----------

