html - 如何在 CSS 中对齐表格
问题描述
我需要将表格向右对齐。我用过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>
推荐阅读
- sql - 具有独特球员组合的团队的 PostgreSQL 表
- asp.net - 在不提示身份验证的情况下从 Web 应用程序查看报告 - Reporting Services 2017
- python - Django:为每个新订单创建参考代码
- arrays - Yasm ebe 如何添加到数组的索引值
- angularjs - 如何修复 Angular js 中的跨站请求伪造漏洞?
- css - 反应中的自定义模态背景变暗
- elasticsearch - 为什么聚合脚本在弹性搜索中不起作用?
- objective-c - 静态变量上的 Objective-C 内存管理
- c# - 在 XML 中插入 xsi:schemaLocation 和 xlmns 和前缀
- ruby-on-rails - 获取深度哈希数组中键值的总和