2016-09-28 51 views
1

我有这样一些列的剑道格:标题文本

columns: [ 
    { 
     title: 'Test', 
     field: 'SomeField', 
     width: '200px' 
    }, 
    { 
     title: 'Extra long example title', 
     field: 'SomeOtherField', 
     width: '100px', 
     headerAttributes: { style: "white-space: normal" } 
    }, 
    ... 
] 

我的长标题被包裹没有任何问题。但是,这并不需要得到每个包裹短列标题,显示在标题中这样的底部:

+------------+------------+ 
|   | Extra long | 
|   | example | 
| Test  | title  | 
+------------+------------+ 

不过,我想有标题在这样的报头的开头:

+------------+------------+ 
| Test  | Extra long | 
|   | example | 
|   | title  | 
+------------+------------+ 

我尝试添加headerAttributes: { style: "margin-top: 0" }到第一列,但它并没有改变任何东西。我怎么能做到这一点?

+2

vertical-align:top? – ArtemKh

+1

@ArtemKh Omg是的,没想到那... –

+1

@ArtemKh请张贴它作为答案得到代表。 –

回答

0

ArtemKh的评论是解决我的问题。我只需将vertical-align: top添加到我的headerAttributes即可在单元格顶部显示标题。