当前位置: 代码迷 >> Web前端 >> 让报表不自动扩展
  详细解决方案

让报表不自动扩展

热度:37   发布时间:2012-11-23 22:54:33.0
让表格不自动扩展
<style type="text/css">
<!--
td { word-wrap: break-word; word-break: break-all; }
-->
</style>
<table width="500" border="1" cellspacing="1" cellpadding="1">
<!--table width="30%" border="1" cellspacing="1" cellpadding="1"-->
  <tr>
  <td>AAAA</td>
  <td width=300>
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  </td>
  <td>aaa</td>
  </tr>
  <tr>
  <td>BBBB</td>
  <td>xxxx</td>
  <td>bbbb</td>
  </tr>
</table> 

?表格td中的在不设置表格宽度或者表格宽度小于实际占用时会自动将表格扩展,不会自动换行

nowrap表示不换行,如果行的宽度不设置或者小于实际的宽度,则会将单元格撑宽,而不会换行

  相关解决方案