如何使表格边框在所有浏览器上工作?



我有一个带边框的表格。目前,边框在 Brave 浏览器上工作。在Chrome和Safari上,边界延伸得太远。如果我把它变小,边框在<td>之前结束.有没有办法让它只和<td>一样长?抱歉,如果这真的很明显,我对此有点陌生,无法在网上找到任何信息。现在我有:

/* not much to show but this is what happens in Chrome/Safari */
table {
display: block;
text-align: center;
font-family: ‘Jost’, sans-serif;
border: 7px solid red;
border-radius: 13px;
width: auto;
margin-right: 8%;
margin-left: 8%;
border-spacing: 3px;
}
td {
background-color: yellow
<table>
<tr>
<td>text</td>
<td>text</td>
<td>text</td>
<td>text</td>
<td>text</td>
</tr>
</table>

从 W3: 块 - 将元素显示为块元素(如

(。它从一条新行开始,并占据整个宽度

删除显示类型:https://www.w3schools.com/cssref/pr_class_display.asp

相关内容

最新更新