شرح صفوف ومحتوى الفقرة
تُستخدم خاصية [cellpadding] داخل عنصر <table> في HTML لعمل مسافات داخل الخلايا بين المحتوى النصي وبين إطار الخلية.
قيمة الخاصية cellpadding:
- تكتب في الصيغة التاريخية عددًا مثل cellpadding="10". قد تتسامح المتصفحات مع px في الشفرة القديمة، لكن لا تعتمد على ذلك. ومع ذلك، يُفضل في التصميمات الحديثة استخدام CSS لتحديد المسافات.
البديل الحديث يطبق على الخلايا نفسها، مثل th, td { padding: 10px; }، وليس على table وحده.
Cellpadding Without Pixel
كتابة القيمة داخل خاصية cellpadding دون وحدة px.
HTML
<table border="1" bordercolor="red" bgcolor="yellow" width="500" cellpadding="10">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Email</th>
<th>Age</th>
<th>Study</th>
</tr>
</table>
Cellpadding With Pixel
مثال تاريخي على تسامح المتصفح مع px داخل cellpadding، وليس الصيغة الموصى بها.
HTML
<table border="1" bordercolor="red" bgcolor="yellow" width="500" cellpadding="10px">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Email</th>
<th>Age</th>
<th>Study</th>
</tr>
</table>