gpt4 book ai didi

html - 表格上方的标签

转载 作者:太空宇宙 更新时间:2023-11-03 20:34:26 24 4
gpt4 key购买 nike

所以我有这个

echo   
"<div class=''>
<table class='table' border='1'>
<tr class='head'>

<th>Section Name</th>
<th></th>
<th>Ae</th>
<th>Pt</th>
<th>Prin</th>

我怎样才能在它上面得到一个漂亮的标签,它看起来像是表格的一部分,但它位于 THs 上方的中间,我希望它代表表格名称,例如它会说。表 1 居中并位于该表上方,但仍在表的边框中。

最佳答案

我会插入一个 <caption> 开口之间的元素 <table>元素和第一个<tr>喜欢:

<table style="width: 100%">
<caption>Table 1</caption>
<tr>...

<caption>几乎是为此而生的:

The HTML <caption> Element (or HTML Table Caption Element) represents the title of a table.Though it is always the first descendant of a <table>, its styling, using CSS, may place it elsewhere, relative to the table.

关于html - 表格上方的标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35512470/

24 4 0