<html>
<head>
<style type="text/css">
body {background-color: yellow}
table {
width:400px;
border-collapse: collapse;
cellspacing:0;
}
td{
border: 1 solid black;
}
</style>
</head>
<body>
<table>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
</body>
</html>
将以上代码放入记事本中,然后把记事本后缀名修改为xls
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
</head>
<body link=blue vlink=purple>
<table x:str border=1 cellpadding=0 cellspacing=0 width=500 style='border-collapse:
collapse;table-layout:fixed;width:375pt'>
<col width=200 style='mso-width-source:userset;mso-width-alt:6400;width:150pt'>
<col width=300 style='mso-width-source:userset;mso-width-alt:9600;width:225pt'>
<tr height=19 style='mso-height-source:userset;height:14.25pt'>
<td height=19 class=xl24 width=200 style='height:14.25pt;width:150pt'
x:str="'20000" u1:num>20000</td>
<td class=xl25 width=300 style='width:225pt'>hello</td>
</tr>
<tr height=19 style='height:14.25pt'>
<td height=19 align=right style='height:14.25pt' x:num>3000</td>
<td>world</td>
</tr>
<![if supportMisalignedColumns]>
<tr height=0 style='display:none'>
<td width=200 style='width:150pt'></td>
<td width=300 style='width:225pt'></td>
</tr>
<![endif]>
</table>
</body>
</html>
加边框。可以控制不用COM组件