<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表示不换行,如果行的宽度不设置或者小于实际的宽度,则会将单元格撑宽,而不会换行