-3

I am confused about this ques that is it, mandatory to use any of the below tags when we use <thead> tag?

<tbody> <tfoot>

Both of the above or none of the above?

Paulie_D
  • 107,962
  • 13
  • 142
  • 161
Neha
  • 3
  • 1
  • 1
    No, if you do not add a `tbody`, the browser will add it for you. `tfoot` is not a mandatory element. – Paulie_D Jan 19 '21 at 10:00

1 Answers1

0

Neither are required! But it's a cleaner to add tbody when you have a thead.

<table>
  <thead>
    <tr>
      <th>Month</th>
      <th>Savings</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>January</td>
      <td>$100</td>
    </tr>
    <tr>
      <td>February</td>
      <td>$80</td>
    </tr>
  </tbody>
</table>
Pierre
  • 1,129
  • 2
  • 16
  • 30