# Why is this digraph label incorrect? graphviz says "syntax error"

**URL:** <https://forum.graphviz.org/t/why-is-this-digraph-label-incorrect-graphviz-says-syntax-error/3218>\
**Category:** Help\
**Created:** [October 17, 2025, 10:08am UTC](https://forum.graphviz.org/t/why-is-this-digraph-label-incorrect-graphviz-says-syntax-error/3218 "2025-10-17T10:08:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![folkert](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/folkert/32/2013_2.png) [@folkert](https://forum.graphviz.org/u/folkert)\
**Post date:** [October 17, 2025, 10:08am UTC](https://forum.graphviz.org/t/why-is-this-digraph-label-incorrect-graphviz-says-syntax-error/3218/1 "2025-10-17T10:08:04Z")

</div>

Hi,

I’ve got the following node definition in a .dot file:

```auto
        21 [label=<<b>AttributeCreator_5 [AttributeCreator]</b><br/><table border="0" cellspacing="0"><tr><td valign="middle"> </td><td><table border="1" cellpadding="2" cellspacing="0"><tr><td>New Attribute</td><td>Value</td></tr><tr><td>message</td><td>&lt;li&gt;@Value(message)&lt;/li&gt;</td></tr></table></td></tr></table>>];

```

Graphviz says:

```auto
Error: syntax error in line 1
... <br/><table border="0" cellspacing="0"> ...
in label of node 21

```

Why is it wrong? There is no space before the table-tag etc?

I tried `[label=< <b>AttributeCreator_5` but that did not help (same error).

---

<div class="post-metadata">

**Author:** ![scnorth](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/scnorth/32/89_2.png) [@scnorth](https://forum.graphviz.org/u/scnorth)\
**Post date:** [October 17, 2025, 1:16pm UTC](https://forum.graphviz.org/t/why-is-this-digraph-label-incorrect-graphviz-says-syntax-error/3218/2 "2025-10-17T13:16:42Z")

</div>

Two things.

Running this label through an HTML formatter shows it is malformed. There is a spurious at the beginning of the nested table in line 7.

```auto
<b>AttributeCreator_5 [AttributeCreator]</b>
<table border="0" cellspacing="0">
   <tr>
      <td valign="middle"> </td>
      <td>
         <table border="1" cellpadding="2" cellspacing="0">
            </tr>
            <tr>
               <td>New Attribute</td>
               <td>Value</td>
            </tr>
            <tr>
               <td>message</td>
               <td>&lt;li&gt;@Value(message)&lt;/li&gt;</td>
            </tr>
         </table>
      </td>
   </tr>
</table>

```

Second, apologies this is not obvious, but you can’t concatenate the initial text line and an HTML table.I don’t know how well this is documented, but you can see this in the graphviz source code for the html parser:

```auto
html : T_html fonttext T_end_html { scanner->parser.lbl = mkLabel($2,HTML_TEXT); }
      | T_html fonttable T_end_html { scanner->parser.lbl = mkLabel($2,HTML_TBL); }
      | error { cleanup(&scanner->parser); YYABORT; }
      ;

```

Graphviz HTML is only HTMLish, not actually HTML.

When in doubt, try to build from small examples that work quickly, to larger ones.
