zoukankan      html  css  js  c++  java
  • 如何根据表格的宽度修改td内字符串长度

    就是,当提供的位置变得窄时能够自动截断需要显示的字符,比如this is a test string.当宽度不够时,就显示this is a ...(或者更少)当宽度够时就全部显示在微软新闻组中看到类似的东西,这里中间的分隔条拖动的时候,左边标题列表的宽度会发生变化,标题文字就自动显示成适合宽度的长度了

     <table border="1" style="table-layout: fixed;">    
        
    <tr>      
            
    <td width="102" style="overflow: hidden; text-overflow: ellipsis">fdsfdsafdsafdsafdsafdsafdsafdsa</td>      
            
    <td width="117" >dddd</td>    
        
    </tr>    
        
    <tr>      
            
    <td >d</td>      
            
    <td >d</td>    
        
    </tr>  
     
    </table>

    注意table-layout: fixed  overflow: hidden; text-overflow: ellipsis

  • 相关阅读:
    导出表结构
    smarty cache
    浏览器插件
    互联网技术网站介绍
    目录拷贝
    sphinx搜索不到
    powerdesigner 导出数据库表结构
    PowerDesigner 连接 mysql
    update join
    ClipboardJS的坑,
  • 原文地址:https://www.cnblogs.com/nasdaqhe/p/579044.html
Copyright © 2011-2022 走看看