Page 72 - modular_v2.0_HTML&_CSS_Fb
P. 72
6 TABLES IN HTML
Your Aim
to learn about:
l Creating Tables
l CSS Properties used with <TABLE> Tag
l Attributes of the <TD> Tag
l Attributes of the <TR> Tag
Similar to MS Word, you can also create different types of tables on web pages using HTML5. In
the previous chapter, you learned the basic tags for lists in HTML. In this chapter, you will learn
how to create tables in HTML5.
CREATING TABLES
Tables represent the data in the form of rows and columns. In HTML5, 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>: The <TR> stands for Table Row, and is used to start a row. It ends up with </TR>. It
is a container tag.
<TD>: The <TD> tag stands for Table Data. This tag is used for defining table data, that is,
the data of the cells. It is a container tag.
<CAPTION>: This tag is used for defining the title of the table. It is a container tag.
<TH>: The <TH> tag stands for Table Heading and is used to define the heading of a table.
It is a container tag.
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
70
Touchpad MODULAR (Ver. 2.0)

