2017-03-09 35 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

谢谢你这是我需要;) –

相关问题