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

 <!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>

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