Rowspan attribute understanding

When creating tables the rowspan attribute: rowspan=“2” and rowspan=“3” are explained as: 1. The second row contains the Morning row heading, along with Work , which spans two rows under the Saturday column. The “Relax” entry spans three rows under the Sunday column.

My question is why doesn’t rowapan=“3” attribute affect Saturday column as well as Sunday since the number is higher?

Saturday Sunday
Morning Work Relax
Afternoon
Evening Dinner

The colspan and rowspan attributes apply to the individual cell only so the saturday and sunday values can be different.

What tells it which cell to apply to?

The element where you apply the attribute is the cell that will do the spanning. Where that appears in you table structure determines where the span starts from. the subsequent rows need to account for those spans from higher rows in the table

<table>
// row1
<tr>
  <td></td>
   <td></td>
  <td></td>
</tr>
//row 2
<tr>
  <td></td>
   <td rowspan='2'></td>
  <td rowspan = '3'></td>
</tr>
//row 3 - has only one <td> due to row span from row 2
<tr>
  <td></td>
 
</tr>

//row 4 - has only two <td> due to row span from row 2
<tr>
  <td></td>
   <td></td>
</tr>


</table>

In the original example the “Work” cell spans rows “morning” and “afternoon” in the “saturday” column, while “Relax” spans all three of the time rows for “sunday” column

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.