把TD的width写死
并且在TD中加CSS
word-break : normal

解决方案 »

  1.   

    按上面写的会撑开表格
    不会有超过200的单词了吧?
    如果想断开可以加
    word-break:break-all
      

  2.   

    我只是举个例子,单词的宽度超过200象素是很正常的
    word-break:break-all会把单词断开的
      

  3.   

    我明白楼主的意思了,我以为上面的200是单词长度,象素是很有可能超过,SORRY
    你的意思是不是说如果单词不超过TD的长度就不要断开单词,另起一行新写单词
    而超过TD的长度就要断开单词,不能撑开表格。
    可以通过word-wrap来实现
    <table width=300 border=1 >
    <tr>
    <td style="width:100;word-wrap:break-word">
    asdasdasddsfsdfsdfsdfsdfsdfsdfaaaa dfssdfsddddddddddddddddddddddddddddd
    </td>
    <td style="width:200">
    asdasdasd
    </td>
    </tr>
    </table>
      

  4.   

    不好意思
    想再问下
    text-justify : auto |inter-word | newspaper | distribute | distribute-all-lines | inter-ideograph
    我刚才试试了,好像不能左右对齐
      

  5.   

    这句需要把text-align属性设置为justify才可以运行<div style="text-align:justify;text-justify:inter-ideograph;width:100;background-color:red;">
    1sdasdas dasdasdasd
    2asda sdasd
    3asda sdasdasd
    4asdas dasd
    5as dasdasda sdasdasd
    6asdasda
    </div>