شرح صفوف ومحتوى الفقرة
لم تكن height سمة قياسية لعنصر table في مواصفات HTML؛ تفسرها بعض المتصفحات تفسيرًا غير قياسي، وغالبًا كحد أدنى للارتفاع.
قيمة height attribute:
- يمكن تحديد قيمة height بوحدة البيكسل مباشرةً، حيث يمكن كتابتها كرقم فقط مثل ["height="300] وقد تتسامح بعض المتصفحات مع صيغة height="300px"؛ ليست هذه صيغة قياسية لسمة table.
ومع ذلك، فإن استخدام CSS يفضل في التصميمات الحديثة لضبط أبعاد العناصر بشكل أكثر دقة ومرونة.
Height Attrubute Without Px
استخدام خاصية height دون وضع وحدة px.
HTML
<table border="1" bordercolor="red" bgcolor="yellow" width="100%" height="500">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Email</th>
<th>Age</th>
<th>Study</th>
</tr>
</table>
Height Attribute With Px
مثال على تفسير تاريخي غير قياسي؛ اكتب height:300px في CSS للشفرة الحديثة.
HTML
<table border="1" bordercolor="red" bgcolor="yellow" width="100%" height="500px">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Email</th>
<th>Age</th>
<th>Study</th>
</tr>
</table>