Page 123 - CodePilot V5.0 C7
P. 123
<TH>Name</TH> The following table summarises the CSS properties that can be used to style the <TABLE> element:
<TH>Grade</TH> Property Name Value Description
<TH>Gender</TH> In earlier versions of HTML, BORDER BORDER-WIDTH, BORDER-STYLE, Shorthand property to set the
you can change the style of
</TR> BORDER-COLOR border’s width, style and colour in
unordered list by using the
<TR> one declaration.
TYPE attribute.
<TD>1</TD> BORDER-WIDTH Length in pixels (px) Specifies the width of the table
border.
<TD>Aryan</TD>
<TD>A</TD> BORDER-STYLE DOTTED, DASHED, SOLID, DOUBLE, Used to apply the outline style of
GROOVE, RIDGE, INSET, OUTSET, the border of the table or any other
<TD>Male</TD>
NONE and HIDDEN element.
</TR>
BORDER-COLOR Colour Name, Hexadecimal value Allows you to apply a colour to the
<TR>
or RGB value border.
<TD>2</TD>
<TD>Ananya</TD> Syntax: BORDER: BORDER-WIDTH BORDER-STYLE BORDER-COLOR;
<TD>B</TD> When the same CSS style is needed for different elements, selectors can be grouped. By separating
selector names with commas, a single CSS rule can style multiple elements at once.
<TD>Female</TD>
Syntax for defining a common style for more than one HTML tag:
</TR>
Tag1_name, Tag2_name, Tag3_name,…..
<TR>
{
<TD>3</TD>
Property1_name: value;
<TD>Arjun</TD>
……………….
<TD>A</TD> Tables were first introduced in
HTML 3.2 (1997). PropertyN_name: value;
<TD>Male</TD>
}
</TR>
For example:
</TABLE>
TABLE, TH, TD {
</BODY>
BORDER: 2PX SOLID #3498db;
</HTML>
}
The above code groups TABLE, TH and TD to apply the same CSS styling to all three elements.
CSS PROPERTIES USED WITH THE <TABLE> TAG Code Write the HTML code to present the given web page using CSS properties to style an
11 HTML table.
CSS provides several properties to style the appearance of a table. These include BORDER,
BORDER-STYLE, BORDER-COLOR, BORDER-SPACING, BORDER-COLLAPSE, WIDTH, PADDING, <!DOCTYPE HTML>
BACKGROUND-COLOR and COLOR. Since these are global CSS properties, they can be applied <HTML>
not only to tables but also to other HTML elements.
<HEAD>
<TITLE>States of Matter</TITLE>
121
Lists and Tables in HTML5

