I am showing list of items on UI. Those items have attribute as tLevel. Depending on tLevel value I want to create tree structure.
Something like this
item1 tLevel=0
item2 tLevel=1
item3 tLevel=2
item4 tLevel=1
item5 tLevel=2
item6 tLevel=3
item7 tLevel=3
item8 tLevel=3
item9 tLevel=0
item10 tLevel=1
item11 tLevel=1
HTML template
<div class="treeLevelCSS(' + tLevel + ')" />
CSS should be something like
.treeLevelCSS(tLevel){
"margin-left: " + (tLevel * 15) + "px"
}
I am not sure what I have written above in HTML and CSS is right, but just to give an idea of what I want to achieve here.