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

Tables in HTML

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Tables in HTML

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

Table in

HTML
allows you to organize
and arrange data into
Allows
columnsyou
andtorows.
divide
your page into sections
where you can place the
header, footer, and
Tables navigations links
Almost web sites are laid
out using tables
Made up of rows and
columns – you can place
any element in each cell
like text or image.
Creating
Table
Tags
• <table> </table>
• <tr> </tr> - table row
• <td> </td> - table
data
• <th></th> - table
header
Modifying Table
Attribute for Table
Attribute Definition Values
Name
Align Indicate the horizontal Left, right,
alignment of the table center
Ex. <table align =
“center”></table>
Backgrou Indicates the Filename or
nd background color of a path
table
Attribute for Table
Attribu Definition Values
te Name
bgcolor Indicate the background Assign name or
color of the table. Ex. hexadecimal
<table bgcolor = value of a color
“red”></table>
border Indicates the thickness of Number of
the border in pixels pixels
Ex. <table border =
Attribute for Table
Attribute Definition Values
Name
bordercol Indicates the color of Assign name or
or the border. hexadecimal
Ex. <table bordercolor value of a color
= “red ”></table>
cellpaddin Indicates the distance Number of
g (in pixels) between the pixels
contents of the cells
Attribute for Table
Attribute Definition Values
Name
cellspacing Indicate the distance Number of pixels
between cells in pixels
Ex. <table cellspacing =
“2”></table>
width Indicates the width of Number of pixels
the table in pixels or or number
percent of the width expressed as
Attribute for table row <tr></tr>
Attribute Definition Values
name
align Indicates the horizontal Left, right,
alignment of the contents center
of the row.
Ex. <tr align
=“center”></tr>
valign Indicates the vertical Top, middle,
alignment of the contents bottom
Attribute for table row <tr></tr>
Attribut Definition Values
e name
bgcolor Indicates the background Assign name or
color of the row. hexadecimal
Ex. <tr bgcolor value of a color
=“red”></tr>
height Indicates the height of the Number of pixels
row in pixels.
Attribute for table data <td></td>
Attribute Definition
name
Align Indicates the horizontal alignment of
the contents of the cell.
Ex. <td align =“center”></td>
valign Indicates the vertical alignment of the
contents of the cell.
Ex. <td valign =“bottom”></td>
Attribute for table data <td></td>
Attribute Definition
name
background Indicates the background image of the
cell.
Ex. <td background
=“picture.png”></td>
bgcolor Indicates the background color of the
row.
Attribute for table data <td></td>
Attribute Definition
name
Height Indicates the height of the cell in pixels.
Ex. <td height=“200”></td>
Width Indicates the width of the table in pixels
or percent of the width of the table. Ex.
<td width =“200”></td>
Attribute for table data <td></td>
Attribute Definition
name
nowrap Inhibit word wrapping in the cell.
Ex. <td nowrap></td>
Colspan Merges multiple cells
Ex. <td colspan =“2”></td>
rowspan Merges multiple rows
Ex. <td rowspan =“2”></td>
Activity1
Practice Creating a table based
on your Class Schedule apply
all the attribute in table, tr, and
td also you can add picture.

You might also like