How to align a table which is inside another table?
greetings all i have a table which is inside a row of another table and i wan开发者_如何学编程t to control the alignment of this table to make it centre or right how to do so ? (i tried the align attribute, and it didn't work) here's a sample:
<table>
<tbody>
<tr>
<td>
<table> <!-- i want to control the alignment of this table -->
<tbody><tr>
<td>TD1</td>
<td></td>
</tr>
<tr>
<td>TD2</td>
<td></td>
</tr>
</tbody>
</table>
</td>
</tr>
try
<div align="center">
or
<center>
your table
</center>
I would think something like
<table>
<tbody>
<tr>
<td style="text-align:right">
<table> <!-- i want to control the alignment of this table -->
<tbody><tr>
<td>TD1</td>
<td></td>
</tr>
<tr>
<td>TD2</td>
<td></td>
</tr>
</tbody>
</table>
</td>
</tr>
Also, make sure the width of the cell that your nested table is going into has some free space so that the nested table can move around. I.e. set width of the td and the nested table.
精彩评论