Html Table – code program example

Html Table – Table is two dimension structure, with rows and columns making collection of cells, in which we can display our data.

Html Table
Html Table

To create Html Table in website or blog, “table” tag is used to display or create html table as shown below :

Html Table – code program example

<table border="1">
<tr>
<th>Name</th>
<th>Post</th>
<th>Salary</th>
</tr>
<tr>
<td>Geeta</td>
<td>Manager</td>
<td>20000</td>
</tr>

<tr>
<td>Ravi/td>
<td>clerk</td>
<td>5000</td>
</tr>
<tr>
<td>Mohan</td>
<td>clerk</td>
<td>5000</td>
</tr>
<tr>
<td>Shyam</td>
<td>Clerk</td>
<td>5000</td>
</tr>
</table>

Output of Html Table – code program example:

Name Post Salary
Geeta Manager 20000
Ravi/td> clerk 5000
Mohan clerk 5000
Shyam Clerk 5000

<table> tag

This tag is used to create table.

<border>tag :

Border is an attribute of tag table which is used to display the border lines of table and its values is defined in pixels.

<tr> tag :

“tr” tag is used to introduce or create a row. Row tag is closed after the end of row.

<th> tag :

“th” is used to write the data in heading format, i.e written in bold letters.

<td> tag :

“td” is used to insert data