HTML Table
Table row and column

It is used to represent data in tabular form. It is defined using the <table > element. It defined by the number of table cells like <td>, and the number of tables row <tr>.

Example

 

<!DOCTYPE html>

<html lang="en">

<head>

        <meta charset="UTF-8">

        <title>Title</title>

</head>

<body>

<table border="2">

       <tr>

            <td> Column1 </td>

             <td> Column2 </td>

      </tr>

</table>>

</body>

</html>

Table Heading

Table heading is created using the <th> tag

Example

<!DOCTYPE html>

<html lang="en">

<head>

       <meta charset="UTF-8">

       <title>Title</title>

</head>

<body>

<table border="2">

       <tr>

           <th> Column 1 </th>

           <th> Column 2 </th>

       </tr>

       <tr>

            <td> Naveen </td>

            <td> kumar </td>

       </tr> </table>>

</body>

</html>

Table background

Table background can be set using these two attribute:

  • bgcolor

       By using this attribute you can set the color of one cell at a time.

  • background  

       This is used to set an image on the background, just one cell at a time.

Example

 

<!DOCTYPE html>

<html lang="en">

<head>

      <meta charset="UTF-8">

      <title>Title</title>

</head>

<body>

<table border="2" bgcolor="blue">

       <tr>

            <td> COLUMN NAME </td>

       </tr>

</table>>

</body>

</html>

Other important tables attribute

In this, we will learn some other attribute with the help of an example to understand within a short time.

  • colspan

  • rowspan

  • thead

  • tbody

  • tfoot

  • caption

  • cellpadding 

  • cellspacing

Conclusion

This tutorial implement all topic related to table and its attributes we have covers all related attribute and and its elements so that I hope it is helpful for creating table inside forms. If anything missing or you want to give some update related this tutorial then you can directly contact us at our official website and if you need any issue related to html form or project then also contact at codersarts official web link.  

Powered  by Codersarts