ad

Tuesday, September 2, 2025

html table cellpadding attribute

html table cellpadding attribute

web designing theory

Cellpadding Tag 

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 ="pixels">

Cellpadding Tag

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>

</head>

</body>

</html>

Cellpadding Tag

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.

Cellpadding Tag  output


 

Related Post:-

html form pattern attribute
html frame tag
html table attribute



No comments:

Post a Comment