DEV Community ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป

Falah Al Fitri
Falah Al Fitri

Posted on

HTML Table rowspan colspan

Cell that spans two rows

To make a cell span more than one row, use the rowspan attribute.


Cell that spans two columns

To make a cell span more than one column, use the colspan attribute.


        <table style="width:100%">

            <tr>
                <th rowspan="2">No</th>
                <th colspan="2">Driver</th>
                <th colspan="2">Team</th>
            </tr>

            <tr>
                <th>Image</th>
                <th>Name</th>
                <th>Logo</th>
                <th>Name</th>
            </tr>

            <tr>
                <td>1</td>
                <td>img1</td>
                <td>name1</td>
                <td>logo1</td>
                <td>name1</td>    
            </tr>

            <tr>
                <td>2</td>
                <td>img2</td>
                <td>name2</td>
                <td>img2</td>
                <td>name2</td>
            </tr>

        </table>
Enter fullscreen mode Exit fullscreen mode

Embed replt

Top comments (0)

12 Gorgeous UI Components for Your Design Inspiration

>> Check out this classic DEV post <<