Use the PORT attribute of a <TD> in "record" shape nodes

Hello.
It would be great if you help me
I need to connect Table1.Field1 with Table2.Foield2
This is me .gv

digraph test {
node [margin="0.01"];
rankdir="LR";

"Table1" [ style = "filled, bold" penwidth = 5 fillcolor = "white" fontname = "Courier New"
shape = "Mrecord" label =<

Table1

Field1

Field2

> ];

"Table2" [ style = "filled, bold" penwidth = 5 fillcolor = "white" fontname = "Courier New"
shape = "Mrecord" label =<

Table2

Field1

Field2

> ];

Table1:f1 -> Table2:f2;

}

And what i have after execution:
Warning: node Table1, port f1 unrecognized
Warning: node Table2, port f2 unrecognized

Where is my mistake?

You never defined the ports

You never defined the ports in your graph. In addition, your use of the Mrecord shape is probably not what you want. The syntax for an Mrecord label uses '|' and curly braces to separate fields and alter table direction, with port IDs indicated in angle brackets.

Thus, you probably want something like

"Table1" [ style = "filled, bold" penwidth = 5 fillcolor = "white" fontname = "Courier New" shape = "Mrecord" label ="{Table1 | <f1> Field1 | Field2}"]

"Table2" [ style = "filled, bold" penwidth = 5 fillcolor = "white" fontname = "Courier New" shape = "Mrecord" label ="{Table1 | Field1 | <f2> Field2}"]

Alternatively, you could use HTML-like labels to define your tables with the PORT attribute to define the port names. See http://www.graphviz.org/content/node-shapes#html.

Thanks a lot for help!

I have done so:

digraph test {
   node [margin="0.01" shape=plaintext];
   rankdir="LR";

"Table1" [label =<<table border="1" cellborder="0" cellpadding="3" bgcolor="white">
    <TR>
    <TD bgcolor="black" align="center" colspan="2"><font color="white">
    Table1</font></TD>
    </TR><TR>
    <TD align="left" port="f1">Field1 </TD>
    </TR><TR>
    <TD align="left" port="f2">Field2 </TD>
    </TR>
</table>> ];

"Table2" [ label =<<table border="1" cellborder="0" cellpadding="3" bgcolor="white">
    <TR>
    <TD bgcolor="black" align="center" colspan="2"><font color="white">
    Table2</font></TD>
    </TR><TR>
    <TD align="left" port="f1">Field1 </TD>
    </TR><TR>
    <TD align="left" port="f2">Field2 </TD>
    </TR>
</table>> ];

Table1:f1 -> Table2:f2;

}

 

Recent comments