HTML Table

HTML Table

In HTML Tables data can be represented in tabular form in HTML. i.e Data can be represented in the form of Rows and Columns. To represent data in <TABLE>
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.

every table row is described with the tag. A table header is defined with the tag. By using default, table headings are bold and targeted. A table records is described with the <TD> tag.
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:

HTML Table

WHEN RUNNING IN A WEB BROWSER:

HTML Table
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. 
For example--
                        <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.
For example--
                        <TABLE ALIGN="CENTER">

It then looks like this--
HTML Table

  • 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.
For example--
                          <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.
For example--
                          <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.
For example--
                          <TABLE CELLSPACING="2" BORDER="3">
  • BGCOLOR-- This is used to set the background color. You can give any color name.
For example--
                         <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.
For example--
                         <TABLE BACKGROUND="Cartoon.gif">              

HTML Table

Post a Comment

0 Comments