Skip to content

Latest commit

 

History

History
64 lines (49 loc) · 1.42 KB

File metadata and controls

64 lines (49 loc) · 1.42 KB

ember/template-table-groups

💼 This rule is enabled in the following configs: strict-gjs, strict-gts.

Requires table elements to use table grouping elements.

Tables should use <thead>, <tbody>, and <tfoot> elements to group related content. This improves accessibility for screen reader users and makes the table structure more semantic.

Rule Details

This rule requires that <table> elements use grouping elements (<thead>, <tbody>, <tfoot>) instead of having <tr> elements as direct children.

Examples

Examples of incorrect code for this rule:

<template>
  <table>
    <tr><td>Data</td></tr>
  </table>
</template>
<template>
  <table>
    <tr><th>Header</th></tr>
    <tr><td>Data</td></tr>
  </table>
</template>

Examples of correct code for this rule:

<template>
  <table>
    <thead>
      <tr><th>Header</th></tr>
    </thead>
    <tbody>
      <tr><td>Data</td></tr>
    </tbody>
  </table>
</template>
<template>
  <table>
    <tbody>
      <tr><td>Data</td></tr>
    </tbody>
  </table>
</template>

References