Search code examples
cssjstree

How do I get a jstree node to display long, possibly multiline content?


When using the jsTree plugin, I need to have a node which displays its full content. Right now, the nodes only display approximately one line of text each. How can I get the nodes in a jsTree to display all of the text in the node without truncating the node's content?


Solution

  • The following CSS code will do the trick:

    .jstree-default a { 
        white-space:normal !important; height: auto; 
    }
    .jstree-anchor {
        height: auto !important;
    }
    .jstree-default li > ins { 
        vertical-align:top; 
    }
    .jstree-leaf {
        height: auto;
    }
    .jstree-leaf a{
        height: auto !important;
    }
    

    This is a modification of the solutions here (height changed to auto) and here, neither of which worked for me on their own.