Chapter7: Advanced HTML: Important Key Points
Chapter7: Advanced HTML: Important Key Points
FAQ’s
Q.No.1. Why tables are used extensively in web pages?
Q.No.2. Explain the various table formatting tags with syntax and example.
Q.No.3. XYZ Co. wants to create an E-Commerce website. The purpose is to display and list the particulars
of product and price.
a. What are your suggestions to the company?
b. Demonstrate your suggestions by preparing a sample webpage.
Q.No.4. Your class teacher asked you to prepare HTML page showing the students name and marks of all
subjects of your class. Demonstrate this to your class teacher by creating an HTML document with
details of two students.
Q.No.5. Your friend Anita is designing an HTML document with Table as its content.
a. Give suggestions to make table more attractive.
b. Support your suggestion using relevant codes.
Q.No.6. All the table attributes are optional. Is it true? Justify your answer?
Syntax:
<table Align=”Left/Center/right”
Border=”value”
Border color=”color”
Width =”value”
Height=”Value”
Bgcolor= “color”
Cell spacing= “value”
Frame= “frame type”>
………. </table>
Attributes of TABLE Tag
Attribute Description
Border Creates a thin line around all cells. The width of the border lines
can be specified as a value in pixels. If specified without any
value, a thin line is created a round all cells. The value 0 is
equivalent to having no border. The larger the value specified the
thicker will be the border.
Height By default a table will be as long as the height of the entries in its
cells. An exact height can be specified here either in pixels or as a
percentage of the browser’s window.
Width By default a table will be as wide as the longest entries in its cells.
An exact width can be specified here either in pixels or as a
percentage of the browser’s window.
Cell spacing Cell spacing means the space between the cell border and table
frame. This space can be adjusted in pixels.
Cell padding Cell padding is the space between the cell border and table frame.
This space can be adjusted in pixels.
Positions the vertically in all cells in row. It may take on the values Top,
Valign Middle, Bottom and Baseline. Middle is the default vertical alignment.
Bgcolor Specifies a background colour for all the cells in a row using colour codes
<TD> tag (table data) The <TD> Tag is used to define a table data cell
Syntax:
<td
Align = ”left/right/center”
Bgcolor = ”color”
Width = ”value”
Background = ”filename”
Rowspan = ”value”
Colspan = ” value”
Valign = ”align-type”>
Data in the cell
</td>
4
Attributes Description
Align Positions the text horizontally in all cells in a row. It may take on
the values Left, Center, left is the default horizonal alignment.
.Positions the values Top, Middle, Bottom and Baseline. Middle
Valign is the default vertical alignment.
Specifies the width of a cell in pixles on as a percentage relative
to the table width.
Width Specifies a background color for a single cell using color codes.
An image can be set as a background of an individual cell. The
Bgcolor filename of image file is specified here.
background
Rows pan Indicates the number of rows a cell should occupy.
Cols pan Indicates the number of columns a cell should occupy.
Attributes Description