How to force table cell content to wrap?

前端 未结 9 1911
渐次进展
渐次进展 2020-11-28 01:59

Heres the entire page * wrappable is defined in a main.css file

/* Wrappable cell
* Add this class to make sure the text in a cell will wrap.
* By default, d         


        
相关标签:
9条回答
  • 2020-11-28 02:32

    Its works for me.

    <style type="text/css">
    
     td {
    
        /* css-3 */
        white-space: -o-pre-wrap; 
        word-wrap: break-word;
        white-space: pre-wrap; 
        white-space: -moz-pre-wrap; 
        white-space: -pre-wrap; 
    
    }
    

    And table attribute is:

    table { 
      table-layout: fixed;
      width: 100%
    }
    

    0 讨论(0)
  • 2020-11-28 02:36

    Just add: word-break: break-word; to you table class.

    0 讨论(0)
  • 2020-11-28 02:37

    If you want fix the column you should set width. For example:

    <td style="width:100px;">some data</td>

    0 讨论(0)
提交回复
热议问题