Home > Web Front-end > CSS Tutorial > How to merge cells in css

How to merge cells in css

藏色散人
Release: 2020-11-17 13:44:39
Original
9303 people have browsed it

How to merge cells in css: first create an HTML sample file; then merge columns by setting colspan; finally merge rows by setting rowspan.

How to merge cells in css

Recommended: "css video tutorial"

Css table merged cells

colspan is a merged column, and rowspan is a merged row. When merging rows, such as rowspan="2", its next row tr will have one less column; when merging columns colspan="2", the columns of this row will be There will be one less column

<table border="1" style={{margin:200}}>
      <tbody>
        <tr>
          <th colspan="2">我是占位符</th>
          <th colspan="2">我是占位符</th>
        </tr>
        <tr>
          <th rowspan="2">我是占位符</th>
          <th>我是占位符</th>
          <th>我是占位符</th>
          <th>我是占位符</th>
        </tr>
        <tr>
          <th>我是占位符</th>
          <th>我是占位符</th>
          <th>我是占位符</th>
        </tr>
      </tbody>
    </table>
Copy after login

Effect

How to merge cells in css

css3 slash header

<td >
    <div class="biaoTou">       
    </div>
</td>
.biaoTou {  
  border-top: 200px #199fff solid; /*上边框宽度等于表格第一行行高*/  
  border-left: 200px #ff8838 solid; /*左边框宽度等于表格第一行第一格宽度*/  
}
Copy after login

The above is the detailed content of How to merge cells in css. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
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