Correction

Correction : Exercice 2 - Tableau avancé

Objectif : utiliser thead, tbody, tfoot et fusionner des cellules avec colspan.

Code corrigé

<table>
  <caption>Résultats étudiants</caption>
  <thead>
    <tr>
      <th>Nom</th>
      <th>HTML</th>
      <th>CSS</th>
      <th>Moyenne</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Lina</td>
      <td>16</td>
      <td>18</td>
      <td>17</td>
    </tr>
    <tr>
      <td>Yanis</td>
      <td>14</td>
      <td>15</td>
      <td>14,5</td>
    </tr>
    <tr>
      <td>Sofia</td>
      <td>19</td>
      <td>17</td>
      <td>18</td>
    </tr>
  </tbody>
  <tfoot>
    <tr>
      <th colspan=\"3\">Moyenne classe</th>
      <td>16,5</td>
    </tr>
  </tfoot>
</table>

Aperçu

Résultats étudiants
Nom HTML CSS Moyenne
Lina 16 18 17
Yanis 14 15 14,5
Sofia 19 17 18
Moyenne classe 16,5

Points à retenir

← Retour à l’exercice