colspan | Sololearn: Learn to code for FREE!
+ 3

colspan

what is colspan???

5th Mar 2017, 9:45 AM
kishor
2 Answers
+ 4
<table> <tr> <td>first row, first cell</td> <td>first row, second cell</td> </tr> <tr> <td colspan="2">second row, covers two cells</td> </tr> </table>
5th Mar 2017, 9:49 AM
Patrik Sokol
Patrik Sokol - avatar
+ 4
'colspan' define the number of cells in a <table> row that are merged. 'rowspan' do same for many cells in a <table> column... Cells merged don't have to be define in <table> tree: if you 'colspan' a cell, the count of <td>s elements in the shared parent <td> must be adapted consequently... ( for a 4 columns table, if you define one <td> with colspan value 2, you will have 3 instead 4 <td> at all in the parent <tr> )
5th Mar 2017, 3:47 PM
visph
visph - avatar