سمة كولسبان <th> HTML

❮ علامة HTML <th>

مثال

جدول HTML بخلية رأس تمتد على عمودين:

<table>
  <tr>
    <th colspan="2">Monthly Savings</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100</td>
  </tr>
  <tr>
    <td>February</td>
    <td>$80</td>
  </tr>
</table>

التعريف والاستخدام

تحدد السمة colspanعدد الأعمدة التي ينبغي لخلية الرأس أن تمتد.


دعم المتصفح

Attribute
colspan Yes Yes Yes Yes Yes

ملاحظة: يدعم Firefox فقط colspan="0"، والذي له معنى خاص (انظر أدناه في جدول "Attribute Values").


بناء الجملة

<th colspan="number">

قيم السمات

Value Description
number Sets the number of columns a header cell should span. Note: colspan="0" tells the browser to span the cell to the last column of the column group (colgroup)

❮ علامة HTML <th>