Centering Table data

Hi<br />
<br />
I would like table data to be aligned to the center. I know that I can keep typing:<br />
<br />
<td align="center"><br />
<br />
for every table cell, but thought there must be an easier way than this. I've tried styles using this:<br />
<br />
td {align: center;}<br />
<br />
and<br />
<br />
td {text-align: center;}<br />
<br />
but neither have worked, any help would be most appreciated!<!--content--><td width="33%"><br />
<p align="center">WHATEVER</p><br />
</td><!--content-->Originally posted by 96turnerri <br />
<td width="33%"><br />
<p align="center">WHATEVER</p><br />
</td> Back in 1997 the "width" attribute was depricated for all but the IMG element and the "align" attribute depricated for all but TH and TD elements.<br />
<br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"<br />
"http://www.w3.org/TR/html4/strict.dtd"><br />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><br />
<title>Example</title><br />
<br />
<style type="text/css"><br />
<!-- <br />
td {text-align:center}<br />
--><br />
</style><br />
<br />
<table summary="Some data"><br />
<tr><br />
<th>&nbsp;</th><br />
<th>Heading</th><br />
<th>Heading</th><br />
<th>Heading</th><br />
</tr><br />
<tr><br />
<th>Heading</th><br />
<td>Data</td><br />
<td>Data</td><br />
<td>Data</td><br />
</tr><br />
<tr><br />
<th>Heading</th><br />
<td>Data</td><br />
<td>Data</td><br />
<td>Data</td><br />
</tr><br />
<tr><br />
<th>Heading</th><br />
<td>Data</td><br />
<td>Data</td><br />
<td>Data</td><br />
</tr><br />
</table><!--content-->o and cos thats so much easier isnt it<!--content-->
 
Back
Top