【发布时间】:2020-04-09 22:05:24
【问题描述】:
我创建了一个 2 行的 html 表。 第二行必须是 colspan="4" 请帮我对齐这些元素。 动作文本和两个按钮以给定宽度居中。 和许可证密钥:ZZZZ-ZZZZ-ZZZZ-ZZZZ 右对齐, 但它没有对齐响应能力。 我想在图片下方对齐许可证密钥:ZZZZ-ZZZZ-ZZZZ-ZZZZ
<table width="100%">
<thead>
<tr className="custom-tr">
<th className="custom-th" width="35%">
Product Name
</th>
<th className="custom-th" width="20%">
Subscription Plan
</th>
<th className="custom-th" width="15%">
Purchased Date
</th>
<th className="custom-th" width="30%" style="text-align: center;">
Actions
</th>
</tr>
</thead>
<tbody>
<tr className="custom-tr">
<td className="custom-td">
ESSENTIAL PC ANTIVIRUS
</td>
<td className="custom-td">
MONTHLY PLAN
</td>
<td className="custom-td">
4/9/2020
</td>
<td className="custom-td" style="text-align: center;">
<button className="border-btn blue-border cursor">
View License Key
</button>
<button className="border-btn danger-border cursor">
Unsubscribe
</button>
</td>
</tr>
<tr className="custom-tr">
<td colspan="4" className="custom-td p-r-21" style="text-align: right;">
<span className="icon-color">
Licence Key :
</span> ZZZZ-ZZZZ-ZZZZ-ZZZZ
<i className="f18 icon-color m-r-5 cursor fas fa-envelope m-l-20" aria-hidden="true"></i>
</td>
</tr>
</tbody>
</table>
【问题讨论】:
-
对不起,看不到图片,你能用css发布你的html代码吗?
-
如果您能提供代码参考,这将对我们有所帮助。你能把代码放在stackbliz上,以便我们更好地理解你的问题。
-
我添加了图片和代码
-
对错误感到抱歉
-
我认为您不需要额外的
<tr>。在按钮下方添加许可证。您将更好地控制布局。