Td cellspacing in IE 8?

hi all,

i know i know i rarely use tables but this is for tabular data,
so please dont give me lectures on the whole using tables thing!

how do i get the cellspacing to work properly in IE8?
http://www.bluecrushdesign.co.za/track/viewcustomers.html

it looks more in ie8 than in firefox…wierd?

.tablemain td{
padding:0.5em;
margin: 0px;
}

Something like this:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
table.address {
    width:98&#37;;
     table-layout:fixed;
     border-collapse:collapse;
}
th.name {width:26%}
th.addr {width:37%}
th.contact {width:22%}
.address th,.address td {
    background:#ccc;
    padding:.7em;
    vertical-align:middle;
    text-align:left;
}
.address td {background:#f5f5f5}
tr.even td {background:#eee}

</style>
</head>
<body>
<table class="address" cellspacing="0" cellpadding="0">
    <thead>
        <tr>
            <th class="name">name </th>
            <th class="addr">address</th>
            <th class="contact">contact number</th>
            <th>other</th>
        </tr>
    </thead>
    <tbody>
        <tr class="even">
            <td>bytebat</td>
            <td>4 battle ridge road</td>
            <td>686767786</td>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td>southeasterdesign</td>
            <td>4 battleridge road</td>
            <td>787877</td>
            <td>&nbsp;</td>
        </tr>
        <tr class="even">
            <td>nike sports limited</td>
            <td>new york</td>
            <td>78977</td>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td>ilovechocolate.com</td>
            <td>my house</td>
            <td>6986876</td>
            <td>&nbsp;</td>
        </tr>
    </tbody>
</table>
</body>
</html>


ahh …thankyou yet again! :wink:

Remove all the height=“32” attribute from the table and then just set the height with padding.


td {
  [B]  padding:0.7em;[/B]
    margin: 0px;
}


A table is the correct element for tabular data so there is no problem using it in your example. However don’t use presentational attributes and style it all with css. Remove all those attributes (heights and widths and bgcolors) and just do it in css.:slight_smile: