Skip to content

Latest commit

 

History

History
56 lines (41 loc) · 1.12 KB

File metadata and controls

56 lines (41 loc) · 1.12 KB

ember/template-no-scope-outside-table-headings

Disallow the scope attribute on elements other than <th>.

Rule Details

The scope attribute is only valid on <th> elements within tables. Using it on other elements (including <td>) is invalid HTML and should be avoided.

Examples

Examples of incorrect code for this rule:

<template>
  <div scope="col">Not a table cell</div>
</template>
<template>
  <span scope="row">Wrong element</span>
</template>
<template>
  <p scope="col">Paragraph</p>
</template>

Examples of correct code for this rule:

<template>
  <th scope="col">Header</th>
</template>
<template>
  <th scope="row">Row header</th>
</template>
<template>
  <div>Content without scope</div>
</template>

References