2. Table
“Table is Combination of Rows and Columns,
Which intersect each other and create cell where
user store the value”
Row/Tuple Cell
Intersect
Column
4. HTML tables allow web developers to
arrange data into rows and columns.
Html table has following element
1. < table >
2. < tr >
:The <table> tag defines an HTML table.
: 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”
8. Table Attribute
The table tag 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
<td> Roll No
<td> Name
</td>
</td>
</tr>
<tr>
<td> 1
<td> Komal
</td>
</td>
</tr>
</table>
A table’s border is specified through BORDER
attribute.(Border = size)
<table Border = “ 1 ” >
<tr>
10. 2. BorderColor Attribute
<td> Roll No </td>
<td> Name </td>
</tr>
<tr>
<td> 1 </td>
<td> Komal </td>
</tr>
</table>
A table’s bordercolor attribute is used to specify the
color of table’s border.(Bordercolor = “Any color”)
<table Border = “ 1 ” Bordercolor = “red”>
<tr>
11. 3. Width and Height 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. <td> Roll No
<td> Name
</td>
</td>
</tr>
<tr>
<td> 1
<td> Komal
</td>
</td>
</tr>
</table>
<table border =”1”width =50% or Height = “50%” >
13. BGColor
We can set background color for whole
table or just for one cell
Syntax
<table
bgcolor="color_name”>
18. Align
Align attribute of Table 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.
21. Valign
The purpose of the 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.
24. Attribute Values
void: It is 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.
29. Syntax
<table rules="value">
Attribute Values
•none : It does not create any lines.
•Groups : It create lines between row and column
groups.
•Rows
•Cols
: It creates line between the rows.
: It creates line between the columns.
•All : It creates line between the rows and
columns.