What is HTML Table Cellpadding Attribute
The HTML cellpadding Attribute use to <table> tag specify the space between the cell content and cell wall. The cellpadding attribute is a set terms of pixels Attribute Values. pixels. It holds the space between the cell content and cell wall in terms of pixels.
Cellpadding set the amount of space between the contents of call and the cell boundary or edge. The default is 1. Cellpadding is an attribute of an. Individual cell in a table, so each cell ina table can have .the its own Cellpadding value.
Syntax
<table cellpadding="value">
<tr>
<td>Content</td>
</tr>
</table>
What is HTML Table Cellpadding Attribute
Program
<!DOCTYPE html>
<html>
<body>
<P>Table without Cellpadding </p>
<table border = "1">
<tr>
<th>month</th>
<th>saving</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
</body>
</html>
What is HTML Table Cellpadding Attribute
Explain Program
Step 1 ]
<!DOCTYPE html>
- Declares the document type.
Step 2 ]
<html>...</html>
- The root element that wraps all content of the webpage.
Step 3]
<body>...</body>
- Contains everything visible to the user on the web page.
Step 4 ]
<P>Table without Cellpadding </p>
Displays a paragraph with the text Table
without Cellpadding
Step 5 ]
<table border = 1>
Starts a table with a border of 1 pixel.
Step 6 ]
<tr>
<th>month</th>
<th>saving</th>
</tr>
This is the header row of the table.
<tr> = table row
<th> = table header cell
"month" and "saving" are the column
headings.
Step 7 ]
<tr>
<td>January</td>
<td>$100</td>
</tr>
This is the data row with:
January in the first column
$100 in the second column
<td> = table data cell
Step 8 ]
</table>
Closes the table.
Step 9 ]
</head>
</body>
</html>
Properly closes the ,<head> ,<body> and <html>
tags.
What is HTML Table Cellpadding
output
Related Post:-
Comments
Post a Comment