Page 129 - CA_165_V2.0_Flipbook
P. 129
</TR>
</TABLE>
</BODY>
</HTML>
The output of the preceding HTML code is as follows:
Table with border.
Notes
The BORDER attribute of <TABLE> tag is not supported in HTML5.
CELLPADDING Attribute
This attribute is used to specify the space between grid line and content in the cell. The spacing can
be increased or decreased by specifying the value in number with this attribute. Syntax to use the
CELLPADDING attribute is as follows:
<TABLE BORDER = "Value" CELLPADDING="Value">
For example:
<TABLE BORDER="2" CELLPADDING="15">
The following HTML code uses the <TABLE> tag with the BORDER and CELLPADDING attributes to
create a table with two rows and four columns, displaying cities and their famous landmarks:
<HTML>
<HEAD>
<TITLE> Working with Table</TITLE>
</HEAD>
<BODY BGCOLOR = "YELLOW">
<TABLE BORDER = "2" CELLPADDING = "10">
<TR>
<TD> DELHI </TD>
<TD> MUMBAI </TD>
<TD> KOLKATA</TD>
<TD> CHENNAI</TD>
More About HTML 127

