SPACE BETWEEN ROWS IN A TABLE USING CSS PROPERTY

SPACE BETWEEN ROWS IN A TABLE USING CSS PROPERTY

Date : 15/11/2019

SPACE BETWEEN ROWS IN A TABLE USING CSS PROPERTY

Introduction

We can use “border-collapse” and “border-spacing” properties to leave space between rows.

border-collapse => Used to specify whether the border of the table is collapse or not.

border-spacing” => Used to set the level of the space between cells. 

Example

<!DOCTYPE html> 
<html> 
    <head> 
        <style> 
            table { 
               border:  1px solid black;
                border-collapse: collapse; 
            } 
            
            th, td { 
                width:150px; 
                text-align:center; 
                border:1px solid black; 
                padding:5px 
              
            } 
           
            .check { 
                border-collapse:separate; 
                border-spacing:25px 15px;
            } 
           
        </style> 
    </head> 
    <body> 
        <center> 
        
        <table class = "check"> 
            <tr> 
                <th>ID</th> 
                <th>Name</th> 
                <th>Age</th> 
            </tr> 
        </table> 
        <table class = "check"> 
            <tr> 
                <td>301</td> 
                <td>AAA</td> 
                <td>20</td> 
                
            </tr> 
            <tr> 
                <td>302</td> 
                <td>BBB</td> 
                <td>24</td> 
                
            </tr> 
            <tr> 
                <td>303</td> 
                <td>CCC</td> 
                <td>21</td> 
                
            </tr> 
        </table> 
        </center> 
    </body> 
</html> 

Output:

Thank you for using phoenix solutions.

admin

Our team has expertise across software and web development, WordPress, e-commerce, mobile applications, UI/UX, cloud and infrastructure, DevOps, CI/CD, API integration, security, testing, automation, and technical support. The team also works with AI-based software solutions, LLMs, AI workflows, AI agents, and intelligent application development to help businesses automate processes and build smarter digital solutions. We focus on developing, deploying, maintaining, and optimising secure, scalable, and reliable technology solutions while helping businesses adopt modern technologies and drive digital transformation.

Leave a Reply

Scroll to Top