html css - table colspan , rowspan

BackEnd_Ash.log·2020년 6월 30일

what is th td

th : table header - A header cell in a <table>

td : table data - A data cell in a <table>

colspan ?? rowspan?

what does colspan= do ?

single table cell to span the width of more than one cell or column.

what does rowspan= do ?

single table cell to span the height of more than one cell or row.

so... why use colspan or rowspan

sometimes it makes sense for a cell to span multiple columns or multiple rows .
This might be used for a header cell that titles a group of columns , ro a side-bar that groups rows of entries.

colspan - example

  <th colspan="2">10</th>
  <th colspan="2">20</th>
  <th colspan="2">30</th>

result table with takes up space 2 cols


rowspan - example

  <th rowspan="2">10</th>

result table height takes up space 2 rows

colspan => table width
rowspan => table height

꾸준함이란 ... ?

0개의 댓글