td定义了width:400px;但在页面里不起作用

来源:互联网 发布:手机淘宝联盟怎么注册 编辑:程序博客网 时间:2024/05/29 18:50
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
#test {table-layout:fixed;}
#test td{width:400px;height:20px;overflow:hidden;text-overflow:ellipsis;word-break:keep-all;}
</style>
</head>
<body>
 <div id="grid_div" style="overflow:scroll; WIDTH: 100%; HEIGHT: 100px">
<table border="1" cellspacing="0" cellpadding="0" id="test">
  <tr>
    <td>asdfasdfasfdasfdasfdasfd</td>
    <td>ewrtwertwertwertwert</td>
    <td>wertwertwetrwertwertwer</td>
    <td>wertwer</td>
    <td>ewtrwetr</td>
  </tr>
</table>
</div>
</body>
</html>
原创粉丝点击