To be more precise, and have HTML code that is proper and complete, you should place the code in question under this:
Code:
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td>$ratingdisplay <b>$thread[title]</b></td>
<td align="right" class="smallfont"> $pagenav</td>
</tr>
</table>
</td>
</tr>
This to allow the <td> and <tr> to close, and allow the new <tr> and <td> to open.