How to merge cells in html table

angryTom
Release: 2020-02-11 17:38:04
Original
21506 people have browsed it

How to merge cells in html table

htmlHow to merge cells in a table

#In html, the colspan attribute is to merge columns, and the rowspan attribute is to merge rows. When merging rows , for example, rowspan="2", the next row tr will have one less column; when merging columns, colspan="2", the column of this row will have one less column.

Recommended learning: html tutorial

Code demonstration:

<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

How to merge cells in html table

Extended information:

rowspan specifies the number of rows that the header cell should span. Note: rowspan="0" tells the browser to make the cell span to the last row (thead, tbody, or tfoot) in the table component.

The above is the detailed content of How to merge cells in html table. 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