`

table 滚动条

 
阅读更多

(转)DIV让固定尺寸的Table或者Td显示较大数量内容是出现滚动条

宽和高一定要加上"PX"

代码一:
<div     style="overflow:auto; width:560; height: 100; border: 0px solid #000000;margin-top: 0px;">
<table>
<tr><td>内容输出</td></tr>
</table>
</div>
说明,overflow:auto表示自动适应,内容超出即出现滚动条;width:560; height: 100;是DIV块的宽和高。


代码二:
<table width="560" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div style="overflow-y:scroll; width:560px; height:100px;">内容输出</div></td>
</tr>
</table>
说明,overflow-y:scroll表示竖向出现滚动条(overflow-X:scroll就是横向滚动条);width:560px; height:100px;是DIV块的宽和高.

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics