The document discusses HTML tables and their structure and attributes. It explains that HTML tables allow arranging data into rows and columns using <table>, <tr>, and <td> tags. It then describes various table attributes like border, width, height, bgcolor, background, frame, align, valign, and rules that can customize a table's appearance and layout.
Table
āTable is Combinationof Rows and Columns,
Which intersect each other and create cell where
user store the valueā
Row/Tuple
Column
Cell
Intersect
HTML tables allowweb developers to
arrange data into rows and columns.
Html table has following element
1. < table > :The <table> tag defines an HTML table.
2. < tr > : Each table row is defined with a <tr> tag
3. < th > / <td> : <td> and <th> tags which defined the
tableās headers and data cells
āTables are useful for the general display of tabular dataā
Table Attribute
The tabletag begins the process of building a
table. It carries a long list of attributes ,
including
1. Border
2. Bordercolor
3. Width
4. Height
5. BGColor
6. BackGround
7. Frame
8. Rules
9. Align
10. Valign
9.
1. Border Attribute
Atableās border is specified through BORDER
attribute.(Border = size)
<table>
<tr>
<td> Roll No </td>
<td> Name </td>
</tr>
<tr>
<td> 1 </td>
<td> Komal </td>
</tr>
</table>
<table Border = ā 1 ā >
10.
2. BorderColor Attribute
Atableās bordercolor attribute is used to specify the
color of tableās border.(Bordercolor = āAny colorā)
<table Border = ā 1 ā >
<tr>
<td> Roll No </td>
<td> Name </td>
</tr>
<tr>
<td> 1 </td>
<td> Komal </td>
</tr>
</table>
<table Border = ā 1 ā Bordercolor = āredā>
11.
3. Width andHeight Attribute
The width property specifies the width of an
element, and the height property specifies the
height of an element.
< Table width=ā50%ā or Height = ā50%ā>
12.
<table Border =ā 1 ā >
<tr>
<td> Roll No </td>
<td> Name </td>
</tr>
<tr>
<td> 1 </td>
<td> Komal </td>
</tr>
</table>
<table Border = ā 1 ā width=ā50%ā or Height = ā50%ā >
13.
BGColor
We can setbackground color for whole
table or just for one cell
Syntax
<table
bgcolor="color_nameā>
Align
Align attribute ofTable can positioning
Tables and their contents in relation to other
elements on the Web page.
Align attributes can be set in two levels
1. Table Alignment
2. The alignment of content inside the
Table Cells.
Valign
The purpose ofthe HTML valign attribute is to
define the vertical alignment of the content of a
table cell.
Value Description
top Sets the vertical alignment of cell content top.
middle Sets the vertical alignment of cell content center.
bottom Sets the vertical alignment of cell content bottom.
Frame
The frame Attributeis used to specify the visibility of
outside borders.
Syntax
<table frame="value">
24.
Attribute Values
void: Itis used to hide the outside border.
above: It is used to display the top outside border.
below: It is used to display the bottom outside border.
hsides: It is used to display the top and bottom outside border.
vsides: It is used to display the left and right outside border.
lhs: It is used to display the left outside border.
rhs: It is used to display the right outside border.
box: It is used to display all sides outside border.
border: It is used to display all outside border.
Rules
The rules Attributeis used to specify the
which parts of the inside borders that should
be visible.
29.
Syntax
<table rules="value">
Attribute Values
ā¢none: It does not create any lines.
ā¢Groups : It create lines between row and column
groups.
ā¢Rows : It creates line between the rows.
ā¢Cols : It creates line between the columns.
ā¢All : It creates line between the rows and
columns.