HTML Table
HTML Table:
Html tables can arrange data like text, images, links and other tables etc, in rows and columns of cells.An html table defines with table tag.
Table row is defined with the <tr> tag. <tr> tag is used to create table rows.
Table header is defined with the <th> tag. <th> tag si used to represent table headings. By default table headings are bold and centered.
A data cell is defined with the <td> tag. <td> cell is used to create data cells.
<!DOCTYPE html>
<html>
<head><title>HTML Table</title></head>
<body>
<table width="500px">
<tr>
<th>Name</th>
<th>Ph. NO</th>
<th>Salary</th>
</tr>
<tr>
<td>Saleem</td>
<td>5649532</td>
<td>500$</td>
</tr>
<tr>
<td>Zahid</td>
<td>2649511</td>
<td>500$</td>
</tr>
</table>
</body>
</html>
<html>
<head><title>HTML Table</title></head>
<body>
<table width="500px">
<tr>
<th>Name</th>
<th>Ph. NO</th>
<th>Salary</th>
</tr>
<tr>
<td>Saleem</td>
<td>5649532</td>
<td>500$</td>
</tr>
<tr>
<td>Zahid</td>
<td>2649511</td>
<td>500$</td>
</tr>
</table>
</body>
</html>
HTML Table Border:
In the <table> tag, border is an attribute of this tag and in used to put a border across all the cells.
If a border is not specified for the table, it will be displayed without borders.
HTML Table, Collapsed Borders:
Add the CSS border-collapse property in order to collapse into one border.
Adding Cell Padding In a Table:
Cell padding is specifies the space between the cell and its border. If you do not specify a padding, the cells will
be displayed without the padding. We can use two attributes called cellpadding and cellspacing for this purpose.
Comments
Post a Comment