Please anyone give a code using rowspan? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

Please anyone give a code using rowspan?

10th Dec 2015, 8:27 AM
Ritesh Ghorse
Ritesh Ghorse - avatar
4 Antworten
+ 2
To use rowspan tag first create at least more than 2 rows using <tr> tag and then in fist or second row in any cell <td rowspan="2">.... </td>
21st Dec 2015, 3:46 PM
Parteek
+ 1
Thanks buddy
22nd Oct 2016, 10:34 AM
Ritesh Ghorse
Ritesh Ghorse - avatar
0
@Himanshu Patel That's wrong. You apply 'rowspan' to a cell (td), not a row (tr). Here's some code that will showcase the use of both 'colspan' and 'rowspan': <html> <head> <style> table, th, td { border: 1px solid black; padding: 10px; border-collapse:collapse; } </style> </head> <body> <table> <tr> <th>Column 1 heading</th> <th>Column 2 heading</th> <th>Column 3 heading</th> </tr> <tr> <td>Row 2, cell 1</td> <td colspan="2">Row 2, cell 2, also spanning Row 2, cell 3</td> </tr> <tr> <td rowspan="2">Row 3, cell 1, also spanning Row 4, cell 1</td> <td>Row 3, cell 2</td> <td>Row 3, cell 3</td> </tr> <tr> <td>Row 4, cell 2</td> <td>Row 4, cell 3</td> </tr> </table> </body> </html>
2nd Jun 2016, 11:13 PM
ZinC
ZinC - avatar
- 3
<body> <table> <tr rowspan="2"> <td>red</td> <td>blue</td> </tr>
1st Mar 2016, 12:55 PM
Himanshu Patel
Himanshu Patel - avatar