Bootstrap 4 Bootstrap 4表单元垂直对齐不';I don’我好像没有按照医生说的那样工作
我无法让Bootstrap 4垂直对齐表格数据单元格顶部的单词“top”。文档似乎非常清晰/简单。对于表格和跨距,他们建议将文本顶部对齐。在我下面的示例中,两者都不起作用。当我在开发者工具栏中查看时,垂直aign:top由Bootstrap中的表类定义应用,但在本例中,浏览器(Chrome)不支持垂直aign:top。我错过了什么Bootstrap 4 Bootstrap 4表单元垂直对齐不';I don’我好像没有按照医生说的那样工作,bootstrap-4,Bootstrap 4,我无法让Bootstrap 4垂直对齐表格数据单元格顶部的单词“top”。文档似乎非常清晰/简单。对于表格和跨距,他们建议将文本顶部对齐。在我下面的示例中,两者都不起作用。当我在开发者工具栏中查看时,垂直aign:top由Bootstrap中的表类定义应用,但在本例中,浏览器(Chrome)不支持垂直aign:top。我错过了什么 <table class="table"> <thead class="thead-light">
<table class="table">
<thead class="thead-light">
<tr>
<th scope="col" class="w-50">Something</th>
<th class="w-50"></th>
</tr>
</thead>
<tbody>
<tr style="line-height: 40px;">
<td><span class="align-top">top</span> </td>
<td class="align-text-top">top </td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td>Contact (if other than owner): </td>
<td>Contact (if other than operator): </td>
</tr>
<tr>
<td>Mailing Address: </td>
<td>Mailing Address: </td>
</tr>
<tr>
<td>City, State, Zip: </td>
<td>City, State, Zip: </td>
</tr>
</tbody>
</table>
某物
顶部
顶部
联系方式(如果不是业主):
联系人(如果不是操作员):
邮寄地址:
邮寄地址:
城市、州、邮编:
城市、州、邮编:
默认情况下,引导表单元格是顶部对齐的。(检查开发工具中的td
将证实这一点。)这些表格单元格显示为中间对齐,只是因为文本太短,无法触发换行。如果给其中任何一个单元格足够的文本换行到第二行,则随着行高的增加,相邻单元格中的文本将保持在顶部附近
Lorem ipsum dolor sit amet,献祭精英,
临时劳工和福利费
麦格纳阿利夸。
顶部
但是,如果您只想将文本放在单元格中更高的位置,而不考虑文本长度,则可以提供任何td
实用程序类,如pt-0 pb-3
,以覆盖引导程序的默认填充.75rem