NCBA&E
Lahore Campus
CREATING TABLE
IN HTML
Submitted to:
Sir Qasim Sb
Muhammad Imran Khan
[Link]-IV
Tables in HTML
How to create tables
Page lay-out using tables
Creating HTML tables
Tables display information in rows and
columns
Tables are commonly used to display all
manner of data that fits in a grid such as train
schedules, television listings, financial reports etc.
In HTML <table> tag is used to start a table while
</table> tag indicates the end of the table
<table> Table Structure </table>
<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