Colspan vs Rowspan

HTML jadvallarida hujayralar bir nechta qator yoki ustunlarga cho'zilishi mumkin.

SU

HTML Jadvalda Colspan va Rowspan

HTML jadvallarida hujayralar bir nechta qator yoki ustunlarga cho'zilishi mumkin.

HTML Jadval - Colspan

Hujayrani bir nechta ustunlarga cho'zish uchun colspan atributidan foydalaning:

Misol:

<table>
  <tr>
    <th colspan="2">Name</th>
    <th>Age</th>
  </tr>
  <tr>
    <td>Jill</td>
    <td>Smith</td>
    <td>43</td>
  </tr>
  <tr>
    <td>Eve</td>
    <td>Jackson</td>
    <td>57</td>
  </tr>
</table>

Eslatma

colspan atributining qiymati hujayraning qancha ustunga cho'zilishini bildiradi.

HTML Jadval - Rowspan

Hujayrani bir nechta qatorlarga cho'zish uchun rowspan atributidan foydalaning:

Misol:

<table>
  <tr>
    <th>Name</th>
    <td>Jill</td>
  </tr>
  <tr>
    <th rowspan="2">Phone</th>
    <td>555-1234</td>
  </tr>
  <tr>
    <td>555-8745</td>
  </tr>
</table>

Eslatma

rowspan` atributining qiymati hujayraning qancha qatorlarga cho'zilishini bildiradi.

Bu usullar orqali HTML jadvallarida hujayralarni kerakli ustun va qatorlarga cho'zish mumkin.

Last updated on

On this page

Xato haqida xabar berish