Use the cellpadding attribute to create some space around the contents of table cells
The cellpadding attribute is similar to the
cellspacing
attribute, which is used to create space between and outside of the table cells.without cell padding
Student Name | Roll Number | Class |
---|---|---|
vinod | 01 | BSC |
Mohit | 02 | BSC |
use Cell padding
Student Name | Roll Number | Class |
---|---|---|
vinod | 01 | BSC |
Mohit | 02 | BSC |
1 Open Notepad
2 write code and paste in notepad
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<table border="10" bordercolor="orange" bgcolor="cyan" cellpadding="5"">
<caption align=top>Student Detail</caption>
<tr>
<th>Student Name</th>
<th>Roll Number</th>
<th>Class</th>
</tr>
<tr>
<td>vinod </td>
<td>01</td>
<td>BSC</td>
</tr>
<tr>
<td>Mohit </td>
<td>02</td>
<td>BSC</td>
</tr>
</table>
</body>
</html>
savas file
Output:
Student Name | Roll Number | Class |
---|---|---|
vinod | 01 | BSC |
Mohit | 02 | BSC |