Column header wrapping when using Angular ui-grid

前端 未结 2 2013
一个人的身影
一个人的身影 2021-02-20 15:21

I have upgraded my AngularJS SPA application from ng-grid v2.0.7 to ui-grid v3 and my column headers no longer wrap around. My column headers are now s

相关标签:
2条回答
  • 2021-02-20 16:05

    I added the following css to get mine to work. The line height auto adjusts when depending on the number of lines needed. When scrolling horizontally, it will change to number of lines based on what is visible.

    .ui-grid-header-cell-label {
        display:inline-block;
        white-space:initial;
    }
    
    0 讨论(0)
  • 2021-02-20 16:13

    I believe I have found a way of wrapping text in the header columns by overriding the ui-grid-cell-contents CSS class.

    .ui-grid-header-cell .ui-grid-cell-contents {
         height: 48px;
         white-space: normal;
         -ms-text-overflow: clip;
         -o-text-overflow: clip;
         text-overflow: clip;
         overflow: visible;
    }
    

    Adding this to my site.css I find the column names are now wrapping onto the next line as expected.

    Works in Chrome (v41) and Firefox (v35).

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