如何让这个类似 graphviz html 的表格在节点中左对齐?

问题描述 投票:0回答:1

我对图表的点描述是:

digraph {
    bgcolor="#3D3F41"
    a [
       shape="box"
       color="white"
       fixedsize=true
       fontcolor="white"
       width="3"
       label=<
                <table BORDER="0">
                    <tr>
                        <td>HELLO</td>
                        <td>There</td>
                    </tr>
                </table>
             >
      ]
}

它产生:

表格位于节点中心,我希望它左对齐或两端对齐。即

Hello There
文本应向左移动。我确实需要使用类似 html 的标签,因为其中一列将是 svg 图像。

我尝试向节点添加

labeljust=l
属性,但输出保持不变。

这可能吗?如果是的话,怎么办?

graphviz dot
1个回答
0
投票

奇怪的是,似乎没有任何简单的方法可以在其节点内对齐表格。
labeljust 仅适用于根图和簇。
这是一个拼凑,将一个单元格添加到右侧,将两个“真实”单元格滑动到左侧。

digraph {
    bgcolor="#3D3F41"
    a [
       shape="box"
       color="white"
       fixedsize=true
       fontcolor="white"
       width="3"
       label=<
                <table BORDER="0">
                    <tr>
                        <td >HELLO</td>
                        <td >There</td>
                        <td  FIXEDSIZE="true" width="96" height="55"> </td>
                    </tr>
                </table>
             >
      ]
}

© www.soinside.com 2019 - 2024. All rights reserved.