gpt4 book ai didi

javascript - 将组织结构图方向从左更改为右

转载 作者:太空宇宙 更新时间:2023-11-04 09:41:11 25 4
gpt4 key购买 nike

我需要更改下方图表的方向,使其从左到右显示,而不是当前从上到下的方向。是否可以通过使用行跨度而不是列跨度来做到这一点。在从上到下的方法中,它全部使用 col span 完成,所以我假设可以使用 row Span 从左到右完成,但我无法开始。

enter image description here

我当前的代码 css 是:

div.orgChart table {
width : 100%;
}

div.orgChart tr.lines td.line {
width : 1px;
height : 20px;
}

div.orgChart tr.lines td.top {
border-top : 1px solid black; /*dashed*/
}

div.orgChart tr.lines td.left {
border-right : 1px solid black;
}

div.orgChart tr.lines td.right {
border-left : 0px solid black;
}

div.orgChart tr.lines td.half {
width : 50%;
}


div.orgChart td {
text-align : center;
vertical-align : top;
padding : 0px 2px;
}

我当前在 HTML 正文中的代码是:

<div id='orgChartContainer'>
<div id='orgChart' class='orgChart'>
<table id='myTable' cellpadding='0' cellspacing='0' border='0'>

<tr><td colspan='4'><div>node</div></td></tr>

<tr class='lines'><td colspan='4'>
<table cellpadding='0' cellspacing='0' border='0'><tr class='lines x'><td class='line left half'></td><td class='line right half'></td></table>
</td></tr>

<tr class='lines v'><td class='line left'></td><td class='line right top'></td><td class='line left top'></td><td class='line right'></td></tr>

<tr>
<td colspan='2'>
<table cellpadding='0' cellspacing='0' border='0'><tr><td colspan='2'><div>node 2</div></td></tr>
</table>
</td>
<td colspan='2'>
<table cellpadding='0' cellspacing='0' border='0'><tr><td colspan='2'><div>node 3</div></td></tr></table>
</td>

</tr>
</table>
</div>
</div>

最佳答案

GetOrgChart 具有从左到右的方向选项。请参阅以下示例:

http://www.getorgchart.com/Demos/Orientation

此外,您还可以根据需要自定义节点

关于javascript - 将组织结构图方向从左更改为右,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39903696/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com