What Mako posted is correct... just compare the AMOUNT of code he posted to do the job vs the amount used to do it with tables...
Mako's code could be reduced further by defining styles in the head rather than inline as there wouldn't be a need to reproduce the formatting for each div, just call them by class.
So you'd put the following inbetween your <head></head> tags:
Code:
<style type="text/css">
.container {
width: 768px;
margin-left:auto;
margin-right:auto;
}
.box {
width:180px;
text-align:center;
float:left;
margin-left:10px;
margin-bottom:10px;
border:#000 1px solid;
}
</style> and this in the page body...
Code:
<div class="container">
<div class="box"><h4>Header1</h4><img src="img1.jpg" alt="img1" /></div>
<div class="box"><h4>Header2</h4><img src="img2.jpg" alt="img2" /></div>
<div class="box"><h4>Header3</h4><img src="img3.jpg" alt="img3" /></div>
<div class="box"><h4>Header4</h4><img src="img4.jpg" alt="img4" /></div>
</div>
Now, if at a later date you want to add more tiles, just add another <div class="box"> *snip* </div> per tile. Above is for 4 tiles in a row. Below will produce 2 rows of 4.
Code:
<div class="container">
<div class="box"><h4>Header1</h4><img src="img1.jpg" alt="img1" /></div>
<div class="box"><h4>Header2</h4><img src="img2.jpg" alt="img2" /></div>
<div class="box"><h4>Header3</h4><img src="img3.jpg" alt="img3" /></div>
<div class="box"><h4>Header4</h4><img src="img4.jpg" alt="img4" /></div>
<div class="box"><h4>Header5</h4><img src="img5.jpg" alt="img5" /></div>
<div class="box"><h4>Header6</h4><img src="img6.jpg" alt="img6" /></div>
<div class="box"><h4>Header7</h4><img src="img7.jpg" alt="img7" /></div>
<div class="box"><h4>Header8</h4><img src="img8.jpg" alt="img8" /></div>
</div>
Have a look at http://www.hotdesign.com/seybold/everything.html
The point of CSS & semantically correct coding is that it massively reduces bandwidth, increases page load times, degrades gracefully for other devices, and is far more accessible to those who may use screen readers etc. Tables should only be used to represent tabular data basically, not for layout and styling.
That said, the code that you use should fall in line with whatever code is compliant for the DOCTYPE statement at the top of your file... otherwise it'll fail validation.