HTML5: How to group the footer content in a table ?
Solution:
HTML Code:
Explanation:
- This HTML code defines a webpage with a table displaying student codes and their respective marks.
- The <table> tag creates a table structure.
- The <thead> tag marks the beginning of the table header section.
- Inside <thead>, a row <tr> with header cells <th> for "Student code" and "% of marks" is defined.
- The <tfoot> tag marks the beginning of the table footer section.
- Inside <tfoot>, a row <tr> with data cells <td> for "Average" and the calculated average marks is defined.
- The remaining <tr> elements outside of <thead> and <tfoot> are for displaying individual student data.
- Each student's data is represented in a row with data cells <td> for "Student code" and "% of marks".
Live Demo:
See the solution in the browser
Supported browser
![]() |
![]() |
![]() |
![]() |
![]() |
Yes | Yes | Yes | Yes | Yes |
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.