使用 HTML 属性折叠边框

Fel*_*A J 4 html

是否有等效于 CSS 属性的 HTML 属性border-collapse: collapse;

我试图仅使用 HTML 实现相同的 1px 边框,而不使用 css。

table{
  border-collapse: collapse;
}
Run Code Online (Sandbox Code Playgroud)
<table border="1px" cellpadding="3">
  <tr>
<td>Row 1</td>
<td>Row 1</td>
<td>Row 1</td>
  </tr>
  <tr>
<td>Row 2</td>
<td>Row 2</td>
<td>Row 2</td>
  </tr>
</table>
Run Code Online (Sandbox Code Playgroud)

div*_*993 8

你可以试试cellspacing

<table border="1px" cellspacing="0" cellpadding="3">
  <tr>
<td>Row 1</td>
<td>Row 1</td>
<td>Row 1</td>
  </tr>
  <tr>
<td>Row 2</td>
<td>Row 2</td>
<td>Row 2</td>
  </tr>
</table>
Run Code Online (Sandbox Code Playgroud)

注意:cellspacing不会与相邻单元格的边框重叠,CSS 属性会这样做。