Monday, January 7, 2019

HOW TO CREATE TABLE

                                                     HOW TO CREATE TABLE

 
  1. Use the HTML <table> element to define a table.
  2. Use the HTML <tr> element to define a table row.
  3. Use the HTML <td> element to define a table data.
  4. Use the HTML <th> element to define a table heading.
  5. Use the HTML <caption> element to define a table caption.
  6. Use the CSS border property to define a border..
                                                               HTML CODE:

<table border="1">
<tr>
<th colspan="3">Heading1</th>
</tr>
<tr>
<td>Row2 cell1</td>
<td>Row2 cell2</td>
<td>Row2 cell3</td>
</tr>
<tr>
<td>Row3 cell1</td>
<td>Row3 cell2</td>
<td>Row3 cell3</td>
</tr>
</table>



<table border="1">
<tr>
<td>Row1 Cell1</td>
<td>Row1 Cell2</td>
<td>Row1 Cell3</td>
</tr>
<tr>
<td>Row2 Cell1</td>
<td>Row2 Cell2</td>
<td>Row2 Cell3</td>
<tr>
<td>Row3 Cell1</td>
<td>Row3 Cell2</td>
<td>Row3 Cell3</td>
</tr>
</table>



<table border="1">
<tr>
<th>Heading 1</th>
<th>Heading 2</th>
<th>Heading 3</th>
</tr>
<tr>
<td>Row2 Cell1</td>
<td>Row2 Cell2</td>
<td>Row2 Cell3</td>
</tr>
<tr>
<td>Row3 Cell1</td>
<td>Row3 Cell2</td>
<td>Row3 Cell3</td>
</tr>
</table>



<table border="1">
<tr>
<th colspan="3">Heading 1</th>
</tr>
<tr>
<td rowspan="2">Row span</td>
<td>Row2 Cell1</td>
<td>Row2 Cell2</td>
</tr>
<tr>
<td>Row3 Cell1</td>
<td>Row3 Cell2</td>
</tr>
</table>

10 comments: