Image

HTML & CSS - HTML TABLES - Cell padding in table

Cell padding in table

We can create the space in the table cell with the help of padding attribute. And there is the two way to do this

a. With cell padding attribute in the table.
b. With padding property in css.
EX
<!DOCTYPE>
<html>  
<head>
<style>  
table, th, td {  
    border: 1px solid black;  
    border-collapse: collapse;  
}  
th, td {
    padding: 10px;
}
</style>  
</head>
<body>  
<table>  
<tr><th>Web programing</th><th>Dextop programing</th></tr>  
<tr><td>Html</td><td>java</td></tr>  
<tr><td>php</td><td>C#.NET</td></tr>  
  </table>  
</body>
</html>  
O/P