Space between two rows in a table using CSS

In this tutorial, we will learn how to define space between two rows using CSS with the help of an example? By Apurva Mathur Last updated : July 12, 2023

How to add space between rows in the table using CSS?

To add space between two rows can be simply done by giving appropriate padding and border spacing by using the padding and border-spacing properties. Padding is the area between the element content and the element border or else we can say, padding is the space around the element. And, the border-spacing property sets the distance between the borders of neighboring table cells.

Example to add space between rows in the table

<!DOCTYPE html>
         table, th, td {
         border: 2px solid cadetblue;
         padding: 10px;
         width: 50%;
         table {
         border-spacing: 20px;
   <body style="padding-top: 70px;">
         <table style="width:70%">
               <th>States of India</th>
               <td>Andhra Pradesh</td>
               <td>Arunachal Pradesh</td>


Example: Space between two rows

CSS Examples »

Comments and Discussions!

Load comments ↻

Copyright © 2024 All rights reserved.