我需要将表格右对齐。我使用了 float:right
,但它仍然无法正常工作。还有其他选择吗?
<table style="text-align:right; width:100%; float:right;">
<td class="route-summary">
<tr>
<th>Drop No.</th>
<th>Route Name/Destination</th>
</tr>
</td>
</table>
如您所见,text-align:right
和 float:right
都不起作用。
最佳答案
感谢您的信息..非常感谢。我正在解决问题。我只是添加了 margin-left 并且它被移动了。 :)
这是代码。
<td>
<div style="text-align:right; margin-left:160px; width:100%;">
<table class="route-summary">
<tr>
<th>Drop No.</th>
<th>Route Name/Destination</th>
</tr>
关于html - 如何在 CSS 中对齐表格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56213710/