首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

#jqgrid

如何固定表单元宽度?

郁闷的阿涛不优雅的人
现在在HTML 5/CSS 3中,我们有了更好的解决方案。在我看来,这个纯粹的CSS解决方案是建议的: ​ table.fixed {table-layout:fixed; width:90px;}/*Setting the table width is important!*/ table.fixed td {overflow:hidden;}/*Hide text outside the cell.*/ table.fixed td:nth-of-type(1) {width:20px;}/*Setting the width of column 1.*/ table.fixed td:nth-of-type(2) {width:30px;}/*Setting the width of column 2.*/ table.fixed td:nth-of-type(3) {width:40px;}/*Setting the width of column 3.*/ <table class="fixed"> <tr> <td>Veryverylongtext</td> <td>Actuallythistextismuchlongeeeeeer</td> <td>We should use spaces tooooooooooooo</td> </tr> </table> ​只需像这样修改代码: table.fixed { table-layout:fixed; width:90px; word-break:break-all;} 结果 ​ [JU8ZE.png] ​... 展开详请

如何固定表单元宽度?

现在在HTML 5/CSS 3中,我们有了更好的解决方案。在我看来,这个纯粹的CSS解决方案是建议的: ​ table.fixed {table-layout:fixed; width:90px;}/*Setting the table width is important!*/ table.fixed td {overflow:hidden;}/*Hide text outside the cell.*/ table.fixed td:nth-of-type(1) {width:20px;}/*Setting the width of column 1.*/ table.fixed td:nth-of-type(2) {width:30px;}/*Setting the width of column 2.*/ table.fixed td:nth-of-type(3) {width:40px;}/*Setting the width of column 3.*/ <table class="fixed"> <tr> <td>Veryverylongtext</td> <td>Actuallythistextismuchlongeeeeeer</td> <td>We should use spaces tooooooooooooo</td> </tr> </table> ​只需像这样修改代码: table.fixed { table-layout:fixed; width:90px; word-break:break-all;} 结果 ​ [JU8ZE.png] ​... 展开详请

相关产品

领券