"."/> ".">

Home  >  Article  >  Web Front-end  >  What attributes should be used to merge two cells in html?

What attributes should be used to merge two cells in html?

藏色散人
藏色散人Original
2020-08-01 11:12:3311730browse

html中合并两个单元格应该使用的属性是“colspan”,“colspan”属性定义单元格应该横跨的列数,其语法是“

<td colspan="number">”。

What attributes should be used to merge two cells in html?

推荐:《HTML视频教程

html中合并两个单元格应该使用的属性是“colspan”。

colspan 属性定义单元格应该横跨的列数。

语法

<td colspan="number">

代码示例:

<table border="1">
  <tr>
    <th>Month</th>
    <th>Savings</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100</td>
  </tr>
  <tr>
    <td>February</td>
    <td>$100</td>
  </tr>
  <tr>
    <td colspan="2">Sum: $180</td>
  </tr>
</table>

运行效果:

What attributes should be used to merge two cells in html?

The above is the detailed content of What attributes should be used to merge two cells in html?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn