# Setting spaces to a treecell

yunchang83
42

hi,
i would like to set spaces, say 10 spacing, in front of a text in my treecell. i have tried doing this: " Test", but it still returns "Test". how am i able to set the spacing?

delete retag edit

## 10 Replies

yunchang83
42

erm... in the above text "Test" with spacing, it is supposed to have some spacing, but even when i put 10 spaces, it still shows as one space. any idea?

yunchang83
42

hi, anyone knows any solution to this?

Cogito
66 1

Hi yunchang83,
You may achieve the effect you want by adjusting the margin between the tree node icon and the text.
Refer to the ZK styling guide here

The sample code below would display the effect you want:
<zk>
<style>
.myTree .z-tree-ico,
.myTree .z-tree-last {
margin-right: 50px
}
</style>
<tree width="400px" sclass="myTree">
<treechildren>
<treeitem>
<treerow>
<treecell label="Item 2" />
</treerow>
<treechildren>
<treeitem>
<treerow>
<treecell label="Item 2.1" />
</treerow>
</treeitem>
</treechildren>
</treeitem>
</treechildren>
</tree>
</zk>

yunchang83
42

hi, thanks for the solution, but that isn't the thing i am looking for. if you were to look at the guide, refer to 2nd column, Description column. that is the column i need to have spacing to differentiate between the different tree levels. still, any idea on that?

yunchang83
42

anyone else has any idea on how to do this?

yunchang83
42

hi, i am still awaiting solution to this problem. is there any updates? thanks in advance.

Cogito
66 1

Try
<treecell>
<label value=" Test" pre="true"/>
</treecell>

9393 3 7 16
http://www.oxitec.de/

@yungchang83

ZUML is XML, not HTLM, so you can use & # 1 6 0; as a special character set for spacing.

read the Developer's Guide: Chapter 7 ZUML with the XUL Elements; Basic Components: Label

<zk>
<label value="Hello" />
<separator />
<label value=" & # 1 6 0 ;   & # 1 6 0 ;    & # 1 6 0 ;    & # 1 6 0 ;    & # 1 6 0 ;   & # 1 6 0 ;   Hello" />
</zk>


best
Stephan

yunchang83
42

hi terry, thanks for the codes, but then that is for normal label. for treecell, i have tried it, it doesn't work.

9393 3 7 16
http://www.oxitec.de/

Have a try with placing a label in the treecell !

[hide preview]