给表格加一个滚动条

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>给表格加一个滚动条</title>
</head>
<body>
<table border=1>
   <tr>
     <td><div style="width:100%;height:100;overflow-x:hidden;overflow-y:scroll">左单元格<br>左单元格<br>左单元格<br>左单元格<br>左单元格<br>左单元格<br>左单元格<br>左单元格<br>左单元格<br>左单元格<br>左单元格<br>左单元格<br>左单元格<br>左单元格<br>左单元格<br>左单元格<br>左单元格<br>左单元格<br>左单元格<br>左单元格<br>左单元格<br>左单元格<br>左单元格<br>左单元格<br>左单元格<br></div>
     </td>
     <td>莱芜大发财信息港
     </td>
   </tr>
</table>
</body>
</html>

 

当高度自动适应:overflow-x:hidden;

设置最大高度:max-height: 445;

高度自适应:height:auto;

 

你可能感兴趣的:(border,scroll)