Search On Google

Saturday, December 29, 2018

HTML tables

What is html table?

An HTML table is defined with the <table> tag.
Tables are useful to display data in tabular form for improving readability.
This is top most tag in table.Table tag have 3 tags internally
<thead> , <tbody> ,<tfoot>

All these three tags have their own advantages.
The <thead> tag is used to group header content in an HTML table.
The <tbody> tag is used to group body content in an HTML table.
The <tfoot> tag is used to group footer content in an HTML table.

What is <TR>, <TD> and <TH> tags:-
Table row is defined with the <tr> tag.
Table data is defined with the <td> tag.
Table header is defined with the <th> tag.

Table header and footer are bold and centered by default.

Table architecture example is below:-


Example with HTML code:--
<table>
  <thead>
    <tr>
      <th>Month</th>
      <th>Salary</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>January</td>
      <td>$900</td>
    </tr>
    <tr>
      <td>February</td>
      <td>$800</td>
    </tr>
  </tbody>
  <tfoot>
    <tr>
      <th>Sum</th>
      <th>$1700</th>
    </tr>
  </tfoot>
</table>
Above HTML code Example  output:--




No comments:

Post a Comment

About Me

My photo
Mumbai, Maharashtra, India