Reputation: 9407
I'm using the Bootstrap Treeview library to display some hierarchical data on a page. I'm trying to have each node of the tree broken down into a few columns but I can't seem to get the elements to do it properly.
If I try using span
elements in the text
property of the tree like this:
<span style="background-color: yellow; width: 50%;">foo</span><span style="background-color: red; width: 50%">foo</span>
I get this output:
If I try using div
elements in the text
property of the tree like this:
<div style="background-color: yellow; width: 50%;">foo</div><div style="background-color: red; width: 50%">foo</div>
I get output like this:
I've tried various combinations all with similar mixed results. What can I do to make the columns all show up on a single line?
Upvotes: 1
Views: 594
Reputation: 923
Div is a block element whereas span is not. Try inline-block styling on the div and give it some width.
div {
display: inline-block;
width: 50px;
}
Upvotes: 1