I had some code that produced a table, and worked perfectly.

This is the code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<table>
<tr class="d0"><th>SCHED DATE<th>AMOUNT
<tr class="d0"><td style="text-align: left;">Aug 1, 2011</a></td><td style="text-align: right;">$100</a></td>
<tr class="d1"><td style="text-align: left;">Jul 27, 2011</a></td><td style="text-align: right;">$100</a></td>
<tr class="d0"><td style="text-align: left;">Jul 20, 2011</a></td><td style="text-align: right;">$100</a></td>
<tr><td>Total:</td><td style="{border-top: grey thin solid; text-align: right;}">$300</td>
</table>
</body>
</html>
Then I added a line so that I could pass html validation at validator.w3.org
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
but that broke my CSS, the right format is gone, and my total line is gone

How can I fix that?
The following portion of your code looks strange :
The
{}arround the style’s values doesn’t seem quite standard (and as you specified, with thedoctypedeclaration, that you want the browser to interpret your code using a well-defined standard…)You should probably remove those
{}, and use something like this — which looks a bit more standard-compliant :Also, as noted by @cthulhu, you are opening
<tr>and<th>tags, but never closing them :<tr>at the beginning of each of the following lines (and others) :<th>tags on the first line :You should add closing
</th>and</tr>tags where needed :