文字和图片把表格撑大的解决方案

xiaoxiao2022-06-12  87

文字输入多了不换行把表格撑大了的修改方法 <table style="word-break: break-all" width="100" border="0" cellspacing="0" cellpadding="0"> 图片把表格撑大的问题 <table width="778"style="table-layout:fixed;"> <tr> <td> <img src="logo.gif" border=0 οnlοad="javascript:if(this.width>540)this.width=540;"> </td> </tr> </table> <table style="table-layout:fixed;"> 这样就可以解决表格和层被撑破。但它会把英文词或图片全部被截断了。 table { table-layout:fixed; word-break:break-all; word-wrap:break-word; } div { word-break:break-all; word-wrap:break-word; } 就可以解决表格和层被撑破。但它会把英文词全部被截断了。 把它改一下,改为以下的代码 后来我发现上述代码改写一下就可以做到既防止表格/层撑破又防止单词断裂了。 如下: 代码 table { table-layout: fixed; word-wrap:break-word; } div { word-wrap:break-word; } 下面的是将超出范围的字省略? <table width="200" border="1" style="table-layout: fixed;"> <tr> <td style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">⊙河南省重点建设成就图片展⊙中原文化港澳行,魅力河南图片展⊙中原文化上海行,魅力河南图片展⊙中原文化北京行,魅力河南图片展⊙中原文化广州行,魅力河南图片展⊙中华人民共和国建国50周年成就展 </td> </tr> </table>
转载请注明原文地址: https://www.6miu.com/read-4933484.html

最新回复(0)