Ncba&E: Creating Table
Ncba&E: Creating Table
Lahore Campus
CREATING TABLE
IN HTML
Submitted to:
Sir Qasim Sb
<tr> tag starts a row of the table and </tr> ends the
row
<td> is used to create a cell inside the row while
</td> ends the cell
The contents of the cell are written between <td>
and </td> tags
<th> tag is used to declare the cell of the
heading row of the table
<table border=“1”>
<tr>
<td> Name </td>
<td> Registration No. </td>
</tr>
<tr>
<td>Ali</td>
<td>MA15-BCOM-1680</td>
</tr>
</table>
Table Attributes
Table level attributes
Row level attributes
Cell level attributes
The Border Attribute: Indicates the presence of
the border around the table
<table border=“1”>
The align Attribute:
<table align= “center, right or left”>
The bgcolor Attribute: sets the background color
of the table
<table bgcolor=“gray”>
The background Attribute: sets the specified
image at the background of the table
<table background=“image-title”>
The height and width Attributes:
The cellpadding Attribute: The cellpadding
attribute is used to create a gap between the edges
of a cell and its contents
<table cellpadding=“50”>
The cellspacing Attribute: The cellspacing
attribute is used to create a space between the
borders of each cell