My HTML table is as simple as it gets:
<table class="dispdtab">
<tr>
<td><b>Dealer: </b></td>
<td>dealername</td>
</tr>
<tr>
<td><b>Address: </b></td>
<td>123 main srr</td>
</tr>
<tr>
<td><b>Contact: </b></td>
<td>Bob Dole</td>
</tr>
</table>
I've been struggling to center this table, but no matter what CSS I try, it just won't cooperate. It's like the table is mocking me, refusing to budge and laughing at my attempts.
Here are some of the CSS styles I've experimented with:
.dispdtab {
margin:0 auto;
text-transform:uppercase;
font-size:.8em;
}
.dispdtab td{
padding:0 .25em;
}
I even attempted adding tbody
after the class name, and tinkered with display:block;
settings. I'm on the verge of resorting to an old-school <center>...</center>
tag.
Interestingly enough, when I added border:1px solid black;
, only the first row was affected by the border.
What am I missing here?