0
Can someone please explain to me the function of the colspan element?
2 Answers
+ 1
The colspan makes it so that one box in the table, can be equal in size or length to any number of bikes above or below it.
Hope that helped!
0
@faith
Bikes?
colspan makes one cell span over several columns and thus taking up the space of the next cell (td) (colspan="2") or more in the same row (tr).
Example:
<table>
<tr>
<td colspan="2">Some content</td>
</tr>
<tr>
<td>Some content</td>
<td>Some content</td>
</tr>
</table>
So basically, we have a table with two rows with two cells each. Without 'colspan' we would have four cells. But we wanted just three where the first cell (td) spans over two columns (colspan) and takes up the second cell's space. Hence we don't need to write the code for that second cell, or for any other amount of td's corresponding to the value of colspan.