源代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>编程字典</title> <style> table, th, td { border: 1px solid black; border-collapse: collapse; } th, td { padding: 5px; text-align: left; } </style> </head> <body> <h2>一个单元格跨两行:</h2> <table style="width:100%"> <tr> <th>姓名:</th> <td>比尔</td> </tr> <tr> <th rowspan="2">电话:</th> <td>55577854</td> </tr> <tr> <td>55577855</td> </tr> </table> </body> </html>
运行结果