HTML Table
In HTML, a table is made up of rows and columns. Every row and columns of the table is divided into cells which tables's data.
A table is created row by row with each row going from left to right. A row is made up of horizontal collection of cells from left to right and columns are made up of cells from top to bottom.
And if we want to give bold data then we can use <TH> tag.And to start the new row we can use <TR> tag.
For example--
HTML CODE:
WHEN RUNNING IN A WEB BROWSER:
HTML Table has some attributes--
- BORDER--The border attribute is used to set the width of the table border. By default, a table has no border. When you apply it using this attribute, a border appears around individual cell. The default value of border attribute is 1.
<TABLE BORDER="3">
It will provide/display border of 3 pixel width.
- ALIGN--The align attribute is used to set the horizontal alignment of the table with respect to the browser window. The possible values for align attributes are left, right and center.
<TABLE ALIGN="CENTER">
It then looks like this--
- WIDTH-- The width attribute is used to set the width of the table. This width can be specified either in pixels or as a percentage of the web browser's window.
<TABLE WIDTH="50%"> Or <TABLE WIDTH="500">
- CELLPADDING--The cellpadding attribute is used to set the amount of space between inner edges and contents of each cell in a table. By default,value of cellpadding is 1 pixel. You can specify the value either in pixels or in percentage value.
<TABLE CELLPADDING="20%" BORDER="3">
- CELLSPACING-- This attribute is used to set the amount of space between the border of individual cells i.e. the amount of space between each individual cell.
<TABLE CELLSPACING="2" BORDER="3">
- BGCOLOR-- This is used to set the background color. You can give any color name.
<TABLE BGCOLOR="RED">
- BACKGROUND-- This is used to set the background image of the table. The contents of the table are displayed over the background image.
<TABLE BACKGROUND="Cartoon.gif">
HTML Table
0 Comments