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.
Hormonal balance plays a pivotal role in overall well-being, influencing various aspects of health, from…
Dog walking is an excellent way to maintain your furry friend's camaraderie and provides many…
Introduction Businesses understand the diverse requirements of mobile applications, which provide a competitive advantage. There…
The Internet of Things (IoT) has recently changed the world. It links gadgets together and…
NFTs, or Non-Fungible Tokens, are revolutionizing the digital economy. These unique digital assets, authenticated through…
It is safe to say that if you are in need of a good laptop…