HTML Table Explained | HTML made easy
HTML Table Explained
Welcome to another new tutorial on HTML guys. In previous tutorial we learnt to insert image and various attributes of <img> in HTML. I hope you had no complication in that tutorial.
If you have any complication, please feel free to contact me here. I will surely explain you anything you had complications with.. You can even get in touch by any of the social media link given below. In the same way please follow me on instagram to keep updated with my newer videos and technical blogs..
So lets begin our tutorial. First of all, a table is created using the tag "<table>" and it's various attributes.. Some popular attributes and their uses are given below.
- border - Specifies the border of the table. More the number more bold and bigger the table border.
- cellspacing - To specify the space between cells..
- Cellpadding - To specify the space between datas of table.
- Style - To add a inline CSS style
- Class - To link the external CSS style
These are the main attributes used. There are some other attributes as well but those come in use for special purpose only..
Let's Create a table
So for creating the table. Please use the tag below.
<table border="2px">
</table>
So the tag above creates a simple layout of table. For inputing the data please have a look at the image and tags mentioned below.
- <th> - Used for inserting the heading for the table data.
- <td> - Used for adding data in column wise. (Used inside <tr> tag)
- <tr> - Used for creating a row.
Below is the tag for table and it's output:
<table border="2px" cellspacing="3" cellpadding="3" style="border: red;">
<tr>
<th>Heading one</th>
<th>Heading two</th>
<th>Heading three</th>
</tr>
<tr>
<td>content one</td>
<td>content two</td>
<td>content three</td>
</tr>
<tr>
<td>content one</td>
<td>content two</td>
<td>content three</td>
</tr>
</table>
Heading one | Heading two | Heading three |
---|---|---|
content one | content two | content three |
content one | content two | content three |
Comments
Post a Comment