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

如何根据表格的宽度修改td内字符串长度 <table border="1" style="table-layout: fixed;">    
如何根据表格的宽度修改td内字符串长度    
<tr>      
如何根据表格的宽度修改td内字符串长度        
<td width="102" style="overflow: hidden; text-overflow: ellipsis">fdsfdsafdsafdsafdsafdsafdsafdsa</td>      
如何根据表格的宽度修改td内字符串长度        
<td width="117" >dddd</td>    
如何根据表格的宽度修改td内字符串长度    
</tr>    
如何根据表格的宽度修改td内字符串长度    
<tr>      
如何根据表格的宽度修改td内字符串长度        
<td >d</td>      
如何根据表格的宽度修改td内字符串长度        
<td >d</td>    
如何根据表格的宽度修改td内字符串长度    
</tr>  
如何根据表格的宽度修改td内字符串长度 
</table>

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

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-29
  • 2021-10-22
  • 2021-06-10
  • 2021-08-05
  • 2021-12-01
猜你喜欢
  • 2021-07-10
  • 2021-12-04
  • 2022-01-11
  • 2022-12-23
  • 2022-12-23
  • 2021-09-23
  • 2022-12-23
相关资源
相似解决方案