Table Tag in HTML | Attributes of Table Tag | Important Tags in HTML

Table Tag in HTML | Attributes of Table Tag | Important Tags in HTML

Table Tag in HTML | Attributes of Table Tag

In this article, we will talk to you about table tag of HTML. If you are a beginner then you should definitely learn about table tag in HTML. In this article, you can get information about the attributes of table tag. We collect this all information from self-practical work. And we also check the articles of W3SCHOOL. W3school is a very good website to learn about HTML.




About Table Tag:

<TABLE> tag defines a table. If you want to draw a table in your web page then you should use table tag in your source code. If you want to draw table then you should know <TH> tag, <TR> tag and <TD> tag.  Here <TH> tag defines a table header and <TR> tag defines table row and <TD> tag defines table data.

Table Tag:

TAG Description
<table> It defines a table.
<th> It defines a table header.
<td> It defines a table data.
<tr> It defines a table row.





Some Attributes of Table Tag:

  1. Border: Border attribute specifies the width of the border of the table. If you want to draw border in your table then you should use border attribute in table tag.
  2. Cellpadding: Cellpadding attribute specifies the space between the cell wall and the cell content.
  3. Cellspacing: Cellspacing attribute specifies the space between two cells. If you want to leave some space in two cells then you should use Cellspacing attribute in table tag.
  4. Align: Align attribute specifies the alignment of values in a table. It can be align a value in left, right and centre.
  5. Width: Width attribute specifies the width of a table. If you want to set width of a table then you should use width attribute in table tag.
  6. Bgcolor: Bgcolor attribute specifies the background color of a table. If you want to use a background color in your table then you should use bgcolor attribute in table tag.





Attributes for <th> and <td> tag:

Attribute Name Type of Value
Align Left, Right, Centre
Bgcolor Color name, rgb(), hexcode
Colspan Number
Rowspan Number
Height Pixel or Percentage
Valign Top, Middle, Bottom
Width Pixel or Percentage

 

Source Code of Table Tag is given below:

<html>

<head>

<title>Table Tag in HTML</title>

</head>

<body>

<table border="2px" bgcolor="sky blue" cellspacing=0px cellpadding=5px width=400>

<tr>

<th>Sr. No.</th>

<th>Name</th>

<th>Age</th>

</tr>

<td>1</td>

<td>Skillmaking</td>

<td>21</td>

</table>

</body>

</html>



Output of TABLE TAG in HTML:
table-tag-in-html

Conclusion:

Now finally, I hope that you have good knowledge of table tag and the attributes of the table tag after reading this article. In this article, we got information about the table tag and the attributes of table tag. Thank you for read this article till the end. If you have any questions regarding this article then you should comment down below in the comment section. And you should share your thoughts regarding this article.  You should also read our more articles regarding web development. I give you some links below, hope you will also love those articles.

List Tag in HTML

Form Tag in HTML

The World’s Best Web Development Courses in 2020

This Post Has 9 Comments

  1. furtdso linopv

    I discovered your blog site on google and check a few of your early posts. Continue to keep up the very good operate. I just additional up your RSS feed to my MSN News Reader. Seeking forward to reading more from you later on!…

  2. Johnf163

    This is one awesome blog post. Keep writing. afggcedgekad

  3. Tracie Trewin

    I really can’t believe how great this site is. Keep up the good work. I’m going to tell all my friends about this place.

    1. skill

      thank you

  4. Maryanne

    Nice post. I was checking consistently your blog and I am impressed! Really useful information specifically the last part? I look after such info much. I had been looking for this certain information for a very long time. Thank you and best of good fortune.

  5. skill

    Thank you

  6. skill

    Thanks for your love.

  7. Pingback: itemprop="name">Google

Leave a Reply