HTML Table

HTML Table is a method of showing data​ as row and column form. They use table to show data or divide web page layout.

Table Tags
< table border=number > ..........</table> = Show table
< th > ..........</th> = show table column header
< tr > ..........</tr> = create table row
< td > ..........</td> = create table data

 Attribute
- width : for table width
- height : for table height
- border = Number: for table border
- borderColor : for table border color
- Bgcolor : for table background color
- Background : for table background image
- Align : for table position (left, right, center)
- VAlign : for table position (top, middle, bottom, baseline) by compare with vertical line
- ColSpan =“Number” : for merge columns
- RowSpan =”Number” : for merge rows
- CellSpacing : for spacing from a cell to a cell
- CellPadding : for spacing from a cell to letter

 Syntax
<Table border=”Number”>
<th> ColumnHeader1</th>
<th> ColumnHeader2</th>
………………………
<th> ColumnHeaderK</th>
<tr>
<td> Data in column1</td>
<td> Data in column2 row1</td>
………………………
<td> Data in columnK</td>
</tr>
<tr>
<td> Data in column1</td>
<td> Data in column2 row2</td>
………………………..
<td> Data in columnK</td>
</tr>
………………………………..
</Table>

Example
<html>
<body>
  <table border=1>
    <th>ID
    <th>Name
    <th>Salary
    <tr>
         <td>1001
         <td>Sok Chan
         <td>$2500
    </tr>
    <tr>
         <td>1002
         <td>Chan Meng
         <td>$15000
     </tr>
   </table>
</body>
</html>