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

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

藏色散人
Release: 2020-08-01 11:12:33
Original
11845 people have browsed it

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

<td colspan="number">”。

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

推荐:《HTML视频教程

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

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

语法

<td colspan="number">
Copy after login

代码示例:

<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>
Copy after login

运行效果:

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template