How to create a table in HTML for any website?
A table is most important thing in a html site. We often use any kind of stats or routine or we can say any type or distinguish between few things, here we need to have a table and in html you need to create everything using table codes.
In this article, we will study about the coding used in creating table in html and explanation.
The coding of a html table should be like this:
<table summary=”Here is my sample table and a description of what it’s about”><caption>Here are something I did.</caption>
And this code will appear in browser like this:
|Playing ball||Watching TV||Sleeping|
Here is the description of the table tags:
<table>This tells the browser that this is the beginning of the table and the summary will not seen anywhere only seen when you are using screen reader (for blind person). You need to close this table tag at the end of the table coding.
<tbody> This tags tells the browser that this is the body of the table and every content should be placed in between this. The codes in between this tag are shown to the user in browser format or we can say in table format. You also need to close this body tag at the end of the body codes like this, </tbody>
<tr>This tr represents a table row and it is specific that everything before the closing tag of this row tag should be in a single row. And the closing tag for this row tag is like </tr>
<th> This tag represents that the tags between the <th> and </th> are the table heading and this also needed to be closed at the end.
<td> This td tag tells the browser that all information contained inside the td is shown in a normal column of information or below the header.
</table> this is the closing tag of the table coding and it should be closed at the ends of the all codes of this table.
Stay tuned for all other information regarding HTML and web development.