...

View Full Version : Center text in table



titanic_fanatic
07-13-2005, 08:59 PM
I'm just trying to center the text in the title cell at the top of this table:



<!-- BEGIN [ringtitle] code -->
<table border="0" style="border: 2px ridge #990033; width: 482px;">
<tr><td style="background: silver"><table style="width: 482px;" cellpadding="5" border="0">
<tr>
<td colspan="3" style="border: 2px ridge #990033; width: 134px; background: #000000;"><p style="text-align: center; margin: 0">
<a href="[cgiURL]/home.pl?ringid=rollersports;siteid=[siteid]"
target="_top" style="color: #ffffff; font: bold 18pt arial, helvetica, sans-serif">[ringtitle]</a></p></td>
</tr><tr>
<td border="0" style="width: 134px; background: #990033">
<p style="text-align: center; margin: 0">
<a href="[cgiURL]/prev.pl?ringid=rollersports;siteid=[siteid]"
target="_top" style="font: bold 12px arial, helvetica, sans-serif; color: #ffffff;">Previous Site</a></p><br>
<p style="text-align: center; margin: 0">
<a href="[cgiURL]/prev5.pl?ringid=rollersports;siteid=[siteid]"
target="_top" style="font: bold 12px arial, helvetica, sans-serif; color: #ffffff;">Previous 5 Sites</a></p><br>
<p style="text-align: center; margin: 0">
<a href="[cgiURL]/rand.pl?ringid=rollersports;siteid=[siteid]"
target="_top" style="font: bold 12px arial, helvetica, sans-serif; color: #ffffff;">Random Site</a></p>
<br>
<p style="text-align: center; margin: 0">
<a href="[cgiURL]/list.pl?ringid=rollersports;siteid=[siteid]"
target="_top" style="font: bold 12px arial, helvetica, sans-serif; color: #ffffff;">List Sites</a></p>
</td>
<td border="0" style="width: 214px; background: #ffffff;"><img src="http://www.rollersports.ca/images/wbackgrnd.jpg" width="213" height="199"></td>
<td border="0" style="width: 134px; background: #990033"><p style="text-align: center; margin: 0">
<a href="[cgiURL]/next.pl?ringid=rollersports;siteid=[siteid]"
target="_top" style="font: bold 12px arial, helvetica, sans-serif; color: #ffffff;">Next Site</a></p><br>
<p style="text-align: center; margin: 0">
<a href="[cgiURL]/next5.pl?ringid=rollersports;siteid=[siteid]"
target="_top" style="font: bold 12px arial, helvetica, sans-serif; color: #ffffff;">Next 5 Sites</a></p><br>
<p style="text-align: center; margin: 0">
<a href="[cgiURL]/search.pl?ringid=rollersports;siteid=[siteid]"
target="_top" style="font: bold 12px arial, helvetica, sans-serif; color: #ffffff;">Search Sites</a></p><br>
<p style="text-align: center; margin: 0">
<a href="[cgiURL]/stats.pl?ringid=rollersports;siteid=[siteid]"
target="_top" style="font: bold 12px arial, helvetica, sans-serif; color: #ffffff;">Ring Stats</a></p>
</td>
</tr>
</table></td></tr>
</table>
<!-- END [ringtitle] code -->


it works fine in Netscape 8, but the text left aligns itself when seen in internet explorer. Can someone help me with hopefully a quick fix to this problem.

Thanks,
Titanic Fanatic

_Aerospace_Eng_
07-13-2005, 09:35 PM
Lose the width in this cell

<td colspan="3" style="border: 2px ridge #990033; width: 134px; background: #000000;"><p style="text-align: center; margin: 0">
<a href="[cgiURL]/home.pl?ringid=rollersports;siteid=[siteid]"
target="_top" style="color: #ffffff; font: bold 18pt arial, helvetica, sans-serif">[ringtitle]</a></p></td>
Also why are you using inline styling? Why don't you use an embedded or external stylesheet?

titanic_fanatic
07-13-2005, 09:40 PM
Thanks, that worked.

The reason I'm using inline for this one is that it going to be webring and this is the code that people are going to have to put in their page for the ring. I don't want to add extra steps for these people just to add external css for my webring.

Thanks again,
Titanic Fanatic



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum