Page 48 - Modular_V1.1_Flipbook
P. 48
05 TABLES IN HTML
Your Aim
to learn about:
l Attributes of the <TABLE> Tag l Attributes of the <TD> Tag
l Attributes of the <TR> Tag l HTML Code to Create a Table
Tables represent the data in the form of rows and columns. In HTML, a table is created by using
the <TABLE> tag. It is a container tag. The <TABLE> tag should be defined inside the <BODY> tag.
Different kinds of tables can be created by using the following child tags of the <TABLE> tag:
<TR>: This tag is used for defining table rows.
<TD>: This tag is used for defining table data, that is, the data of the cells.
<CAPTION>: This tag is used for defining the title of the table.
<TH>: This tag is used for defining table headings.
Following is an example of a table:
Table: Student
Roll No. Name Grade Gender
1 Aarav B M
2 Gauransh A M
3 Himakshi A F
4 Rakshit B M
Where, Table: Student is the Title of the table which can be inserted by using the <CAPTION>
tag. Roll No., Name, Grade and Gender are the table headings that can be created by using the
<TH> tag.
ATTRIBUTES OF THE <TABLE> TAG
The following attributes are used to present a table efficiently:
BORDER: The BORDER attribute is used to set the border of the table. The default value of
the BORDER attribute is 0. You can set the border of the table by providing numeric value
to the BORDER attribute in the following way:
<TABLE BORDER="2">
46 Touchpad MODULAR (Version 1.1)-IX

