gpt4 book ai didi

html - 如何在表格标题下放置水平线?

转载 作者:太空宇宙 更新时间:2023-11-04 14:18:52 25 4
gpt4 key购买 nike

我正在尝试放置水平尺 <hr />在表格标题下方 <th>几乎没有成功。如果没有黑客,这可能吗?

这是 HTML我正在使用以及我已经尝试过的东西

<div id="epd" class="editProfileDiv">    
<form>
<table align="center">
<th> Profile Information </th>
<tr>
<hr />
</tr>
<tr>
<td>Name: </td>
<td><input id="name" name="name" value="<?php echo $_SESSION['name'];?>" placeholder=" Jon Doe" type="text" class=""></td>
</tr>

这段代码在浏览器中是这样的

----<hr/> is here----
Profile Information
Name: <text input>

然后我试了一下

<th> Profile Information </th>
<hr />
<tr><td> something here </td></tr>

结果完全相同,<hr/>位于表头之上

还有这个……

<tr> 
<td> <hr /> </td> // If I only use one it only spans half the width of the table
<td> <hr /> </td>
</tr>

其中放置了 <hr/>在正确的位置,但它们之间显然有间隙,这不是我想要的。

现在我知道我可以使用表格标题,而使用常规段落或任何文本,并根据需要设置样式。在这一点上,它只是校长,因为这让我很烦。那么问题又来了:这可能吗?

最佳答案

试试这个:

<tr> 
<td colspan="2"> <hr /> </td>
</tr>

关于html - 如何在表格标题下放置水平线?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17775441/

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