Design-time guidelines for zero-border tables

    Zero-border tables (border="0") are common in layouts such as invoice templates, where the printed or exported output must show no grid lines at all. At design time, though, that same invisible border hides cell boundaries from you as the author inside the WinForms HTML Editor: it becomes hard to place the caret, select a column, or see how many cells a row actually contains. This page shows how to give those cells a visible design-time guideline while you edit, without it ever leaking into the saved output.

    SpiceLogic WinForms HTML Editor showing a zero-border invoice table with no visible cell boundaries, making it hard for the designer to place the caret or select a column.

    Options.ZeroBorderTableGuidelineCss

    Set Options.ZeroBorderTableGuidelineCss to give cells inside zero-border tables a visible outline at design time. The property holds a CSS rule body that the editor applies only while editing, scoped to those cells; it never appears in DocumentHtml or BodyHtml, so it never reaches the saved output.

    // Set once during designer initialization. htmlEditor1.Options.ZeroBorderTableGuidelineCss = "border: 1px dashed #c0c0c0;";

    Once set, every cell in every zero-border table shows a dashed outline, so the table structure stays visible while editing.

    Side by side: the zero-border invoice table with dashed guideline outlines visible at design time on the left, and the same table with guidelines turned off on the right.

    Customizing the guideline look

    The CSS value can be any rule body valid on a <td>. A few examples:

    // Default-ish: dashed gray. "border: 1px dashed #c0c0c0;"  // Wireframe look: dotted blue, no fill. "border: 1px dotted #6699cc;"  // Solid gray with a soft background tint so // designers can spot empty spacer cells at a glance. "border: 1px solid #e8e8e8; background-color: #fafafa;"

    Three variants of the zero-border table guideline style: dashed gray, dotted blue, and solid gray with background tint.

    Why the saved HTML stays clean

    The guideline CSS lives in a design-time-only style block that the editor manages as part of its own chrome; it is not part of the document tree. DocumentHtml output contains only the original table with border="0" and nothing else: no inline borders, no leftover style rules from the design surface.

    Turning it off for preview mode

    For a read-only preview instance that should render the document exactly as the end user will see it, with no design-time decoration, clear the property:

    previewEditor.Options.ZeroBorderTableGuidelineCss = string.Empty;
    previewEditor.Options.ZeroBorderTableGuidelineCss = String.Empty

    An empty string turns the guidelines off entirely, so the preview renders with no visible borders, matching the final output.

    The invoice zero-border table in the editor's read-only preview mode, with no guideline decoration, matching the final printed output.

    Last updated on May 15, 2026

    Put this into practice.

    .NET WinForms HTML Editor Control ships with free C# and VB.NET sample projects and a 14-day evaluation.

    Prefer a guided look? Book a free live demo with our engineers - live on Zoom or Teams, never a chatbot.