gpt4 book ai didi

html - 如何使html表格标题跨越多行

转载 作者:技术小花猫 更新时间:2023-10-29 12:40:46 24 4
gpt4 key购买 nike

我有一些表格标题,例如:

<table>
<tr>
<th>
Invoice Number
</th>
<th>
Invoice Date
</th>

...

我想在标题的不同行上使用不同的词,所以我这样做了:

<table>
<tr>
<th>
Invoice<br />Number
</th>
<th>
Invoice<br />Date
</th>

...

这可行,但我不确定它是否符合最佳实践。我在网络广播中听说你真的不应该使用 <br />不再使用标签来格式化输出的外观,而应该使用 css 以便您可以更轻松地更改它。

谁能提出更好的方法来做到这一点?

最佳答案

您可以将其编码为:

<table>
<tr>
<th>
<div>Invoice</div><div>Number</div>
</th>
<th>
<div>Invoice</div><div>Date</div>
</th>

...

尽管坦率地说,我认为使用 <br /> 没有任何问题。标签。

关于html - 如何使html表格标题跨越多行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7986383/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com