dimanche 22 novembre 2020

HTML table element still used for several checkbox positioning, or are there better alternatives available?

I was wondering if the HTML table element is still up to date for positioning several checkbox input fields in an orderly manner, or if there are better options available, for example with css or other html elements?

Here my example:

<table>
  <tr>
    <td><label for="grade1">Grade 1</label></td>
    <td><input type="checkbox" name="grade1" id="grade1" checked></td>
  </tr>
  <tr>
    <td><label for="grade2">Grade 2</label></td>
    <td><input type="checkbox" name="grade2" id="grade2"></td>
  </tr>
  <tr>
    <td><label for="grade3">Grade 3</label></td>
    <td><input type="checkbox" name="grade3" id="grade3"></td>
  </tr>
  <tr>
    <td><label for="grade4">Grade 4</label></td>
    <td><input type="checkbox" name="grade4" id="grade4"></td>
  </tr>
  <tr>
    <td><label for="grade5">Grade 5</label></td>
    <td><input type="checkbox" name="grade5" id="grade5"></td>
  </tr>
  <tr>
    <td><label for="grade6">Grade 6</label></td>
    <td><input type="checkbox" name="grade6" id="grade6"></td>
  </tr>
  <tr>
    <td><label for="grade8">High school</label></td>
    <td><input type="checkbox" name="grade8" id="grade8"></td>
  </tr>
</table>



Aucun commentaire:

Enregistrer un commentaire