Table Body Question


#1

After looking up a YouTube video on and and <tfooter I think I understand a little better. These tags (or are they elements) will all the css to apply the elements to them as well as where each section will show up on the page. Is this correct?

I don’t understand the explanation for the Table Body. It states the table body

contains all the table’s data excluding the table heading. Not sure I understand this.

<table>
  <tbody>
    <tr>
      <th></th>
      <th>Saturday</th>
      <th>Sunday</th>
    </tr>
    <tr>
      <th>Morning</th>
      <td rowspan="2">Work</td>
      <td rowspan="3">Relax</td>
    </tr>
    <tr>
     <th>Afternoon</th>
    </tr>
    <tr>
      <th>Evening</th>
      <td>Dinner</td>
    </tr>
  </tbody>
</table>

#2

i think these docs:

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tbody

explain it really well, i highly recommend you to read them, and come back to this topic if you still have any questions left afterwards


#3

Thank you for the link.

I apologize my original post was not written out more clearly.

After reading the link I learned one interesting thing. A <tbody> cannot be used as a child element if the <tr> child element is already there.


#4

well, you can still add the table body after writing the table row code, you just need to ensure table body is child of table and table body is a parent of the table row

table body can’t be a child element of table row.


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.


#6