colspan | Sololearn: Learn to code for FREE!



what is colspan???

3/5/2017 9:45:25 AM


3 Answers

New Answer


<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>


'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> )