Posted September 29th, 2009 by admin
Tables consist of <table> element and other related tags. These other tags are nested inside the <table> tag.
The child tags of the <table> elements are as follows:
<caption>
<colgroup>
<thead>
<tfoot>
<tbody>
<tr>
An example would where the <table> tag can be used is:
<table border = "1">
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
</table>
The above code would be rendered as below in the HTML Web Page:
Posted August 8th, 2009 by admin
<table> tag in HTML is used for rendering TABLES in the html web page. <th>, <tr> and <td> tags are used in conjunction with the <table> tag to draw a table in HTML.
<th> tag is used for the header row. There can be only one occurence of header row in a table. Text within this tag is bolded.
<tr> tag signifies a row in table. A Table consists of multiple rows.
<td> tag signifies the data in table. All data/content comes inside the <td> tag. A Row contains of multiple <td> tags.
<table border="1">
<tr><th>Heading1</th><th>Heading2</th></tr>
<tr><td>Row1 Col1</td><td>Row1 Col2</td</tr>
<tr><td>Row2 Col1</td><td>Row2 Col2</td></tr>
</table>
The above code will display a table of 2X2 dimensions as shown below:
| Heading1 |
Heading2 |
| Row1 Col1 |
Row1 Col2 |
| Row2 Col1 |
Row2 Col2 |