Search code examples
htmlgraphvizdot

How to make aligned bold text without tables in Graphviz?


I found that aligned bold text you can create with this code. But Is there any way to do the same without creating tables?

digraph G {
  rankdir=LR; 
  node [shape=record, style="rounded,filled", fillcolor="#F7F7F7", fontname="Arial", fontsize=12];

  A [label=<<table border="0" cellborder="0" cellspacing="0">
      <tr><td align="left"><b>Title</b></td></tr>
      <tr><td align="left">Some text</td></tr>
      </table>>];
}

enter image description here

I don't know how to place align="left" to the line B [label=<<b>Title</b>>];. For some reason alignment doesn't work with bold text.


Solution

  • I found the answer:

    digraph G {
      rankdir=LR; 
      node [shape=record, style="rounded,filled", fillcolor="#F7F7F7", fontname="Arial", fontsize=12];
    
      A [label=
        <<b>Title</b><BR ALIGN="LEFT"
        />Some text<BR ALIGN="LEFT"/>>];
    }