td{
width:100px
height:50px}
/*设置单元格宽度100px,高度50px*/
示例如下:
给出html元素
1
2
345
6789
10
11
设置单元格高度和宽度样式
table{border-collapse:collapse}
td{
border:
1px
solid
green
/*边框*/
width:100px
/*单元格宽度*/
height:50px
/*单元格高度*/
text-align:center
/*单元格文字居中对齐*/
test1:<table>
<tr>
<td height="30"></td>
<td></td>
</tr>
</table>
test2:
<table height="150">
<tr>
<td></td>
</tr>
</table>
test3:
<table>
<tr>
<td style="height:35px"></td>
</tr>
</table>
test4:
<table style="height:350pxoverflow:hidden">
<tr>
<td></td>
</tr>
</table>
亲,你想要哪个效果呢?
在样式里固定<style>td{height:20pxline-height:20px}
</style>
在html中固定
<td height=20></td>