データテーブルにキャプションを付けるためにデータセルまたはヘッダーセルを使用しないでください

ルールID: table-fake-caption
ルールセット: axe-core 4.10
ユーザーへの影響: 深刻
ガイドライン: WCAG 2.1 Experimental, WCAG 2.0 Experimental, Section 508, EN 301 549
 

Start building more accessible experiences

Axe DevTools Pro helps dev teams find and fix up to 80% of accessibility issues while coding. No experience required. Get started with your free trial today.

Compliance Data & Impact

User Impact

深刻
Minor
Critical

Disabilities Affected

  • 視覚障害
  • 視聴覚障害

Standard(s)

  • WCAG 2.1 Experimental
  • WCAG 2.0 Experimental
  • Section 508
  • EN 301 549

WCAG 達成基準 [WCAG 2.1 Experimental]

  • 1.3.1: 必須: Info and Relationships

WCAG 達成基準 [WCAG 2.0 Experimental]

  • 1.3.1: 必須: Info and Relationships

Section 508 ガイドライン

  • 1194.22: 必須: Web based intranet and Internet Information & Applications
  • 1194.22 (g): 必須: Row and column headers shall be identified for data tables.” and “(h) Markup shall be used to associate data cells and header cells for data tables that have two or more logical levels of row or column headers.

    修正方法

    この問題を修正するには、セルと colspan 属性を使って視覚的にキャプションを表すのではなく、テーブルに実際の caption 要素を使うようにします。

    スクリーン・リーダーのユーザーがテーブル形式のデータを理解できるようにするには、画面上のタイトルに caption 要素を使用します。

    例: caption 要素を使用したシンプルなデータテーブル

    <table class="data">
        <caption>
          Greensprings Running Club Personal Bests
        </caption>
    Greensprings Running Club Personal Bests
    </caption>
        <thead>
        <tr>
          <th scope="col">Name</th>
          <th scope="col">1 mile</th>
          <th scope="col">5 km</th>
          <th scope="col">10 km</th>
        </tr>
        </thead>
        <tbody>
        <tr>
          <th scope="row">Mary</th>
          <td>8:32</td>
          <td>28:04</td>
          <td>1:01:16</td>
        </tr>
        <tr>
          <th scope="row">Betsy</th>
          <td>7:43</td>
          <td>26:47</td>
          <td>55:38</td>
        </tr>
        <tr>
          <th scope="row">Matt</th>
          <td>7:55</td>
          <td>27:29</td>
          <td>57:04</td>
        </tr>
        <tr>
          <th scope="row">Todd</th>
          <td>7:01</td>
          <td>24:21</td>
          <td>50:35</td>
        </tr>
        </tbody>
      </table>
    

    なぜ重要なのか

    スクリーン・リーダーはテーブルを特定の方法で読み上げます。テーブルが正確にマークアップされていない場合、混乱させるような、あるいは不正確なスクリーン・リーダーの読み上げ内容になる可能性があります。

    テーブルにセルと colspan 属性を使って視覚的にキャプションを表す代わりに、実際の caption 要素でマークアップしないと、スクリーン・リーダーのユーザーはテーブルの目的を正しく理解できません。

    ルールの説明

    データテーブルのマークアップは長く複雑になりやすいです。スクリーン・リーダーはテーブル移動を楽にするいくつかの機能を持っていますが、これらの機能が正しく動作するには、テーブルが正しくマークアップされていなければなりません。いくつかのテーブルは実際の caption 要素ではなく、セルと colspan 属性を使ってキャプションを視覚的に表します。

    仕組みについて (簡単に言うと)

    テーブルセルでマークアップされたデータテーブルが視覚的にキャプションを表すために colspan を用いているか確認します。

    リソース

    axe 4.10 ルールの一覧 を参照する

    この情報は役に立ちましたか?

    すでにフィードバックをいただきました、ありがとうございます。.

    あなたの回答は次のとおりです。

    この情報は役に立ちましたか?
    フィードバックが提出された日付/時刻: