This Graphviz code:
digraph models_diagram {
graph[rankdir=LR, overlap=false, splines=true]
struct1 [shape=record, label="Table 0|<f0> ID: integer|<f1> TABLE_1_ID: integer"]
struct2 [shape=record, label="Table 1|<f0> ID: integer|<f1> NAME: string"]
struct2:f0 -> struct1:f1;
}
Will create this ERD:

I would like to apply special formatting (e.g. back-ground color; font weight) to each rectangle's header (e.g. "Table 1").
I thought about embedding one shape within another, then I could set style=filled, color=lightgrey on one of the shapes, but I can't get the syntax to work.
Is this possible?
This:
digraph models_diagram{
graph[rankdir=LR, overlap=false, splines=true];
node [shape=record, fontsize=9, fontname="Verdana"];
edge [style=dashed];
table0 [shape=none, margin=0, label=<
<table border="0" cellborder="1" cellspacing="0" cellpadding="4">
<tr><td bgcolor="lightblue">Table 0</td></tr>
<tr><td port="0" align="left">ID: integer</td></tr>
<tr><td port="2" align="left">TABLE_1_ID: integer</td></tr>
</table>>];
table1 [shape=none, margin=0, label=<
<table border="0" cellborder="1" cellspacing="0" cellpadding="4">
<tr><td bgcolor="lightblue">Table 1</td></tr>
<tr><td port="0" align="left">ID: integer</td></tr>
<tr><td port="1" align="left">NAME: string</td></tr>
</table>>];
table1:0 -> table0:2;
}
Leads to this:

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With