将表插入
时,我可以以某种方式在
中插入 table 吗- 使用jsTree (1.0) 和
- json
?假设在这段代码中我想为
- 节点和
- 叶子插入表。
为什么?显示更多内容而不仅仅是名称并使用良好的格式。
"data" : [
{
"data" : "A node",
"children" : [ "Child 1", "Child 2" ]
},
{
"attr" : { "id" : "li.node.id" },
"data" : {
"title" : "Long format demo",
"attr" : { "href" : "#" }
}
}
]
更新:
在我看来,我可以使用 html_titles
。但是有人可以给我一个例子如何插入整个表并从变量中获取单元格数据吗?
Update2:
无论我使用
"data" : "<table><tr><td>Site name</td><td>variable 1</td><td>variable 2</td></tr></table>",
还是
"title" : "<table><tr><td>Site name</td><td>variable 1</td><td>variable 2</td></tr></table",
将表格放在新行上。不在树图标旁边。我能以某种方式解决这个问题吗?
Can I somehow insert a table inside <li>
when using
- jsTree (1.0) and
- json?
let's say in this code where I want to insert table for
- both node and
- leaf.
Why? To display more things than only a name and using nice formatting.
"data" : [
{
"data" : "A node",
"children" : [ "Child 1", "Child 2" ]
},
{
"attr" : { "id" : "li.node.id" },
"data" : {
"title" : "Long format demo",
"attr" : { "href" : "#" }
}
}
]
update:
it seems to me that I can use html_titles
. But could somebody give me an example how to insert whole table and get cell data from variables?
Update2:
whether I use
"data" : "<table><tr><td>Site name</td><td>variable 1</td><td>variable 2</td></tr></table>",
or
"title" : "<table><tr><td>Site name</td><td>variable 1</td><td>variable 2</td></tr></table",
the table is placed on a new line. Not next to the tree icon. Can I fix that somehow?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
扩展原始帖子以帮助其他人尝试做同样的事情:
});
关键是允许在核心选项中设置的标题中包含 html 以及表格样式
Expanding on the original post to help others trying to do the same:
});
The key is to allow html in the titles which is set in the core options as well as the table style
我认为它需要在 javascript 级别上解决,但是
可以解决问题
I thought it needs to be solved on javascript level but
<table style='display: inline-block'>
does the trick插件:默认情况下,您提供的“文本”实际上被视为 html。
Addon: The "text" you supply is actually treated as html by default.