<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <title>为表格添加标题</title> <style type="text/css"> thead{ background-color: red; color: white; } tfoot{ background-color: green; } </style> </head> <body> <table border="1" width="400px" align="center"> <caption>这是表格的标题</caption> <thead> <tr> <th nowrap>行头一行头一行头一行头一行头一行头一行头一行头一行头一行头一行头一行头一行头一行头一行头一行头一行头一 行头一行头一行头一行头一行头一行头一行头一行头一行头一行头一行头一行头一行头一</th> <th nowrap>行头二</th> <th nowrap>行头三</th> </tr> </thead> <tfoot> <tr> <th>行尾一</th> <th>行尾二</th> <th>行尾三</th> </tr> </tfoot> <tbody> <tr> <td>内容一</td> <td>内容二</td> <td>内容三</td> </tr> </tbody> </table> </body> </html>