{ "$schema": "../../schemas/code-crispies-module-schema.json", "id": "html-tables", "title": "جداول HTML", "description": "أنشئ جداول بيانات منظمة بترميز دلالي", "mode": "html", "difficulty": "beginner", "lessons": [ { "id": "table-basic", "title": "جداول البيانات", "description": "الجداول تعرض البيانات المنظمة في صفوف وأعمدة. استخدم <table> كحاوية، <tr> للصفوف، <th> لخلايا الرأس و <td> لخلايا البيانات.

أضف <caption> لعنوان قابل للوصول يصف محتوى الجدول.", "task": "أنشئ جدول أسعار:
1. عنصر <caption> يقول Pricing
2. صف رأس مع Plan و Price
3. صفين بيانات لـ Basic ($9) و Pro ($29)", "previewHTML": "", "previewBaseCSS": "body { font-family: system-ui; padding: 20px; background: #f5f5f5; } table { border-collapse: collapse; width: 100%; max-width: 350px; background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.1); } caption { padding: 16px; font-weight: 600; font-size: 1.1rem; color: #333; background: #f8f9fa; } th, td { padding: 14px 20px; text-align: left; border-bottom: 1px solid #eee; } th { background: steelblue; color: white; font-weight: 500; } tr:last-child td { border-bottom: none; } tr:hover td { background: #f8f9fa; }", "sandboxCSS": "", "initialCode": "", "solution": "\n \n \n \n \n \n \n \n \n \n \n \n \n \n
Pricing
PlanPrice
Basic$9
Pro$29
", "previewContainer": "preview-area", "validations": [ { "type": "element_exists", "value": "table", "message": "أضف عنصر <table>" }, { "type": "element_exists", "value": "caption", "message": "أضف <caption> لعنوان الجدول" }, { "type": "element_count", "value": { "selector": "th", "min": 2 }, "message": "أضف خلايا رأس (<th>) لـ Plan و Price" }, { "type": "element_count", "value": { "selector": "tr", "min": 3 }, "message": "أضف 3 صفوف (1 رأس + 2 صفوف بيانات)" } ] } ] }