Robert schreef:
> Probably something simple i'm overlooking, taking the below html and
> css style settings, when you view in a browser (IE or Mozilla for
> example), the table is a tiny bit less wide than the div. Yet I have
> set both to the exact same width (99%) and they have the same border
> settings. This also happens if i use a width like "800px".
For the table, the width = the width of the table + the width of the
border
For the div, the width = the width of the div without the width of the
border
So your table with border has width = 99%
And your div with border has width = 99% + 2 pixels
I simplified your html (see below) and put the table and the div block
in it, first with border, than without. You now clearly see, that it is
the border that is the trouble.
Solution: get rid of the table. Tables are not meant to be used for
layout, they are meant to use for tabular data. If you do use them for
layout, then you run into problems like this. Use div blocks instead.
Look at the css property float for displaying divs next to each other,
like your table cells.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
</head>
<body>
<h1>With borders</h1>
<table style="border: solid 1px #000000; background-color:#FBF5C5;
width:99%; border-bottom-style: none;">
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<div style="border: solid 1px #000000; width:99%; margin: 0px;
padding: 0px; background-color: red"> </div>
<h1>Without borders</h1>
<table style="border-style: none; background-color:#FBF5C5;
width:99%">
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<div style="border-style: none; width:99%; margin: 0px; padding: 0px;
background-color: red"> </div>
</body>
</html>