可我不知怎么插入一个表格内<li>使用时,
让我们在这个代码说,我要插入表格的
为什么?显示更多东西,而不仅仅是名称和使用漂亮的格式.
"data" : [
{
"data" : "A node",
"children" : [ "Child 1", "Child 2" ]
},
{
"attr" : { "id" : "li.node.id" },
"data" : {
"title" : "Long format demo",
"attr" : { "href" : "#" }
}
}
]
Run Code Online (Sandbox Code Playgroud)
更新:
在我看来,我可以使用html_titles.但有人可以给我一个例子,如何插入整个表并从变量中获取单元格数据?
我是否使用
"data" : "<table><tr><td>Site name</td><td>variable 1</td><td>variable 2</td></tr></table>",
Run Code Online (Sandbox Code Playgroud)
要么
"title" : "<table><tr><td>Site name</td><td>variable 1</td><td>variable 2</td></tr></table",
Run Code Online (Sandbox Code Playgroud)
该表放在一个新行上.不在树图标旁边.我可以以某种方式修复它吗?
扩展原始帖子以帮助其他人尝试这样做:
$(function () {
$("#demo1").jstree({
"json_data" : {
"data" : [
{
"data" : "<table style='display: inline-block'><tr><td>Site name</td><td>variable 1</td><td>variable 2</td></tr></table>",
"children" : [ "Child 1", "Child 2" ]
},
{
"attr" : { "id" : "li.node.id" },
"data" : {
"title" : "Long format demo",
"attr" : { "href" : "#" }
}
}
]
},
"core" : {"html_titles" : true},
"plugins" : [ "themes", "json_data" ]
});
Run Code Online (Sandbox Code Playgroud)
});
关键是允许在核心选项中设置的标题中的html以及表格样式
| 归档时间: |
|
| 查看次数: |
5768 次 |
| 最近记录: |