Do you truly mean padding, which is like a margin within the TDs themselves, or a 30px separation between cells in the same row?
If you want a padding, then set the padding-right
to 30px, possibly excepting the TDs in the last column.
If you want a 30px separation between cells in the same row, then you should take a look at border-collapse
. Set the left and right border widths of all TDs to 30px, the border color to the background color of #ddTopMenu
, and border-collapse
to collapse
. You can also set the right and left border widths of the rightmost and leftmost cells, respectively, to 0 so that the 30px separation is only between cells:
<!DOCTYPE html>
<html>
<head>
<style>
#ddTopMenu {
display: inline-block;
border: black 1px solid;
background-color: red;
}
#ddTopMenu td {
background-color: white;
border-left: red 30px solid;
border-right: red 30px solid;
border-collapse: collapse;
}
#ddTopMenu td.first {
border-left-width: 0;
}
#ddTopMenu td.last {
border-right-width: 0;
}
</style>
</head>
<body>
<div id="ddTopMenu">
<table border="0" cellspacing="0">
<tr>
<td width="100" class="first"></td><td >Dictionary</td><td>Search</td><td>Sources</td><td class="last">References</td>
</tr>
</table>
</div>
</body>
</html>