In html there are set of elements that are needed to create tables. Table can be created using <table> element.
Each row of a tables are defines via <tr> element and each cell are defines via <td> element within <tr> element.
<table>
<tr>
<td>Cell</td>
<td>Cell</td>
</tr>
<tr>
<td>Cell</td>
<td>Cell</td>
</tr>
</table> You can set the border using border attribute i.e. border=”1″. Also you can set spacing using cellspacing and cellpadding attribute as below:
<table border="1" cellspacing="5" cellpadding="5">
<tr>
<td>Cell</td>
<td>Cell</td>
</tr>
<tr>
<td>Cell</td>
<td>Cell</td>
</tr>
</table> Table thead, tfoot and tbody:
A tables can be defined using table head i.e. <thead> and table foot i.e. <tfoot>. It is useful when printing a page as header and footer shows on each page automatically. Remember that <thead> use <th> element incase of <td>.
<table>
<thead>
<tr>
<th>Title 1</th>
<th>Title 2</th>
</tr>
</thead>
<tfoot>
<tr>
<td>Footer cell 1</td>
<td>Footer cell 2</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>Cell</td>
<td>Cell</td>
</tr>
<tr>
<td>Cell</td>
<td>Cell</td>
</tr>
</tbody>
</table> You can also set horizontal and vertical alignment using “valign” and “align” attribute.
Battery coating is the process of applying uniform layers of active materials—such as cathode and…
Let’s face it. Tech buzzwords get thrown around a lot—especially when it comes to how…
In today’s digital world, the boundaries between technology, finance, and innovation are rapidly disappearing. Businesses…
Backyard gatherings like BBQs, family reunions, and garden parties are an exciting way to enjoy…
Marketers are always on the lookout for more effective ways to reach their target audiences.…
Does your phone control your mind more than you control your phone? Modern life exploits…