• cellpadding and cellspacing are attributes used to control the spacing and padding within table cells in HTML.
• cellpadding sets the amount of space between the content inside a table cell and the cell's borders.
• cellspacing sets the distance between adjacent table cells, creating gaps between them.
• Both attributes are defined in the <table> tag, like <table cellpadding="value" cellspacing="value">.
• You can adjust the values for cellpadding and cellspacing to increase or decrease the spacing and padding as per your design requirements.
<!DOCTYPE html>
<html>
<head>
<title>cellpadding and cellspacing</title>
<style>
table, th, td {
width:300px;
border: 3px;
border-style: solid;
border-collapse: collapse;
}
</style>
</head>
<body>
<h1>Table cellpadding and cellspacing</h1>
<table cellpadding = "20" cellspacing = "20">
<tr>
<th>Name</th>
<td>Som prakash rai</td>
</tr>
<tr>
<th>Mobile No.</th>
<td>9990399111</td>
</tr>
</table>
</body>
</html>