2017-03-09 31 views
0

我有一個dataView,我想設置我的文字是這樣的 詳細信息:這是一個testttete33 jlkxjcsksjcj jxzlkzxlckjzlcj; c; z zzcjzlcxl; 讓我告訴你我的圖片enter image description here如何設置在dataView表中的文本對齊在extjs

所以你看我的詳細場這是不好的(調整) 這裏是我的代碼

items: [{ 
    xtype: 'dataview', 
    itemSelector: 'table', 
    itemTpl: [ 
    '<tpl for=".">', 
    ' <table width="100%" class="basic" style="min-height:100px;">',      
    '  <tr>', 
    '   <td width="25%"><b>ID #:</b></td>', 
    '   <td width="25%">{id}</td>', 
    '   <td width="25%"><b>Name:</b></td>', 
    '   <td width="25%">{name}</td>', 
    '  </tr>', 
    '  <tr>', 
    '    <td><b>Details:</b></td>', 
    '    <td align="justify">{details}</td>', 
    '  </tr>', 
    ' </table>', 
    '</tpl>' 
    ], 
    bind: { 
    store: '{viewpermission}' 
    } 
}], 
+0

請添加一個簡單的小提琴與您的問題 –

回答

2

您已設置td align=justify,那是你得到的。我在截圖中看到它的工作原理。

你的問題是在別的地方。這是你的表怎麼看起來像現在(誇張由我):

+---------+---------+---------+---------+ 
| ID # | 29  | Name: | testme | 
+---------+---------+---------+---------+ 
| Details:| this is | 
|   | a test | 
|   | for me | 
|   | 1234567 | 
+---------+---------+ 

你大概需要的是

+---------+---------+---------+---------+ 
| ID # | 29  | Name: | testme | 
+---------+---------+---------+---------+ 
| Details:| this is a test for me | 
|   | 1234567      | 
+---------+-----------------------------+ 

所以你真正尋找的是<td align="justify" colspan="3" ...

+0

謝謝你這是我需要;) –

相關問題