Table Border in HTML
Chapter - 6 : Inserting Table in Web Page (Table Border in HTML): (Page 2/3)
(Cotinued from previous page)
iii) Table Border: A table border can be added by using <table border='single'>
e.g. If there are 3 rows and 2 column then
Command: <table border='single'>
<tr> <td>Row 1 Col 1</td>
<td> Row 1 Col 2</td></tr>
<tr> <td> Row 2 Col 1</td>
<td> Row 2 Col 2</td></tr>
<tr> <td> Row 3 Col 1</td>
<td> Row 3 Col 2</td></tr>
</table>
Output
iv) Table Header: The table column headers can be defined with 'th' tag. The header is always displayed in bold letters.
The following command is to be written, just after the <table> command
Command: (insert 'th' tag in above example).
<table border='single'>
<th>Column 1</th>
<th>Column 2</th>
<tr> <td>Row 1 Col 1</td>
<td> Row 1 Col 2</td></tr>
<tr> <td> Row 2 Col 1</td>
<td> Row 2 Col 2</td></tr>
<tr> <td> Row 3 Col 1</td>
<td> Row 3 Col 2</td></tr>
</table>
Output:
(Cont......... to next page (Pg-3))
©
funandhobby.com (Table Border in HTML)