0Pricing
Web Accessibility Academy · درس

th وscope وعنصر caption

امنحوا الجدول عنواناً وخلايا عناوين صحيحة

th وscope وعنصر caption درس مجاني في Web Accessibility Academy على CoddyKit. هذا هو الدرس 1 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Web Accessibility Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Web Accessibility Academy 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

Data Tables Carry Meaning

A real data table shows relationships between rows and columns. Mark it up well and screen readers can announce which header each value belongs to.

A Plain Table Is Confusing

If every cell is just a td, a screen reader reads numbers with no context. The user hears values but never learns what they mean.

<table>
  <tr><td>Name</td><td>Score</td></tr>
  <tr><td>Ada</td><td>92</td></tr>
</table>

Header Cells Use th

Swap header cells from td to th. Now the browser knows those cells label the data, not hold it, and exposes them as headers.

<tr><th>Name</th><th>Score</th></tr>

Why th Changes Everything

A th element is announced as a header and can be tied to the cells it describes. That link is what gives lonely numbers their meaning.

The scope Attribute

Add scope to each th to say which cells it covers. The value is col for a column header or row for a row header.

<th scope="col">Score</th>

scope=col for Top Headers

Use scope=col on the header at the top of a column. Every cell below it inherits that label as the user moves down.

<th scope="col">City</th>

scope=row for Side Headers

Use scope=row on the first cell of a row when it names that row, like a person or a date along the left edge.

<th scope="row">Ada</th>

caption Names the Table

The caption element gives the whole table a title. Screen reader users hear it first, so they know what they are about to explore.

<table>
  <caption>Quiz scores by student</caption>
</table>

caption Must Come First

Place caption as the very first child inside the table, right after the opening tag. Any other position is invalid and may be ignored.

Caption Beats a Heading

A nearby h2 is not enough. The caption is programmatically tied to the table, so users discover the title even when jumping table to table.

A Complete Simple Table

Caption, header row of th with scope, then data rows. This foundation makes most simple tables fully accessible with zero ARIA.

<table>
  <caption>Scores</caption>
  <tr><th scope="col">Name</th><th scope="col">Score</th></tr>
  <tr><th scope="row">Ada</th><td>92</td></tr>
</table>

Quick Check

You are labeling the column header at the top of a table.

Recap: The Three Building Blocks

You learned the trio of accessible tables: th for headers, scope to aim them, and caption to name the table. That is most of the job done.

الأسئلة الشائعة

هل درس «th وscope وعنصر caption» مجاني؟

نعم — نص درس «th وscope وعنصر caption» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Web Accessibility Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Web Accessibility Academy 4 دروس في المجموع.

ماذا ستتعلم في «th وscope وعنصر caption»؟

امنحوا الجدول عنواناً وخلايا عناوين صحيحة تتمرن على Web Accessibility Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ Web Accessibility Academy؟

لا تُشترط خبرة سابقة. Web Accessibility Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 1 من أصل 4.

كم من الوقت يستغرق درس «th وscope وعنصر caption»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس Web Accessibility Academy هذا؟

نعم. كل درس في Web Accessibility Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. th وscope وعنصر caption
  2. إتقان عناوين الصفوف والأعمدة
  3. الجداول المعقدة: إقران headers وid
  4. جداول التخطيط فخ
← العودة إلى Web Accessibility Academy