Skip to content
Related Articles

Related Articles

Improve Article

Space between two rows in a table using CSS?

  • Last Updated : 04 Dec, 2018

The space between two rows in a table can be done using CSS border-spacing and border-collapse property. The border-spacing property is used to set the spaces between cells of a table and border-collapse property is used to specify whether the border of table is collapse or not. The border-spacing attribute can only be used if border-collapse attribute is set to separate.


<!DOCTYPE html>
            table {
                border-collapse: collapse;
            th {
            th, td {
                border:1px solid black;
            .geeks {
            .gfg {
                border-spacing:0 15px;
            h1 {
        <h2>Row spacing in a table</h2>
                <th>Employee ID</th>
        <table class = "gfg">
                <td class = "geeks">10001</td>
                <td class = "geeks">10002</td>
                <td class = "geeks">10003</td>

row spacing in table

Attention reader! Don’t stop learning now. Get hold of all the important Comcompetitivepetitve Programming concepts with the Web Design for Beginners | HTML  course.

My Personal Notes arrow_drop_up
Recommended Articles
Page :