How can I have this graphviz html-like table left aligned in the node?

29 views Asked by At

My dot description of the graph is:

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>
             >
      ]
}

It produces:

result image

The table is centered in the node and I would like it to be left aligned or justified. i.e. the Hello There text should be shifted to the left. I do need to use the html-like label as one of the columns will be a svg image.

I have tried adding the labeljust=l attribute to the node, but the output remained the same.

Is this possible? If so, how?

1

There are 1 answers

1
sroush On BEST ANSWER

Oddly, there does not seem to be any easy way to align a table within its node.
labeljust only applies to Root graph & clusters.
Here is a kludge that adds a cell onto the right side, sliding the two "real" cells to the left.

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>
             >
      ]
}

enter image description here