0% found this document useful (0 votes)
34 views

Ncba&E: Creating Table

Tables in HTML allow for displaying data in a grid format. The <table> tag is used to define a table, with <tr> tags for rows and <td> tags for individual cells. Attributes can be added to tables, rows, and cells to control formatting and styling. Common attributes include border to add borders, bgcolor to set background color, and cellpadding and cellspacing to control spacing.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Ncba&E: Creating Table

Tables in HTML allow for displaying data in a grid format. The <table> tag is used to define a table, with <tr> tags for rows and <td> tags for individual cells. Attributes can be added to tables, rows, and cells to control formatting and styling. Common attributes include border to add borders, bgcolor to set background color, and cellpadding and cellspacing to control spacing.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

NCBA&E

Lahore Campus

CREATING TABLE
IN HTML
Submitted to:
Sir Qasim Sb

Muhammad Imran Khan


M.Com-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

You might also like