<!DOCTYPE html> <html lang="en"> <head> <title>Spanning Columns and Rows in an HTML Table</title> <style> table { border-collapse: collapse; } table, th, td { border: 4px solid black; } th, td { padding: 15px; } </style> </head> <body> <h2>Spanning Columns and Rows</h2> <table> <tr> <th>Name</th> <th colspan="2">Subject</th> <th>Result</th> </tr> <tr> <td>Suresh</td> <td rowspan="3">Math</td> <td rowspan="3">Science</td> <td rowspan="2">Pass</td> </tr> <tr> <td>Kumar</td> </tr> <tr> <td>Babu</td> <td>Fail</td> </tr> </table> </body> </html>