Skip to content

List support in table cells #508

Open

Description

@bmorelli25

Discussed in #503

Originally posted by shainaraskas February 14, 2025
We often need to share a short list of info in a tabular format, but our tables don't support lists.

gh gets around this by allowing for html lists inside of markdown tables (ugly but functional)

we currently work around it using - and <br> but this is not ideal because list items don't wrap properly / use non-standard bullets

example

https://elastic.github.io/docs-builder/versions/#versioning-facets
https://elastic.github.io/docs-builder/versions/#content-patterns

Related to #112

Activity

  1. bmorelli25 commented on Feb 14, 2025

    @bmorelli25
    MemberAuthor
    1. @colleenmcginnis to create list of high-risk tables
    2. Writers fix tables with existing syntax
    3. Figure out what actual requirements are
    4. Build complex table support (potentially as horizontal def list?)
  2. cotti commented on Jun 3, 2026

    @cotti
    Contributor

    AI triage

    Automated investigation against the current codebase. A human still needs to confirm before any code change.

    Original concern

    Authors want to put a real Markdown list inside a table cell, but pipe-table cells only hold inline content, so today they fake it with - and <br>, which wraps badly and uses non-standard bullets.

    Findings

    • src/Elastic.Markdown/Myst/MarkdownParser.cs:185 — the pipeline registers only .UsePipeTables(). Markdig pipe-table cells are parsed as inline-only content (a single paragraph of inlines), so block-level constructs like lists cannot live in a cell. No UseGridTables() is registered anywhere (confirmed via git log -S "UseGridTables" — never present), and grid tables are the Markdig extension that does allow block content in cells.
    • src/Elastic.Markdown/Myst/MarkdownParser.cs:192 — .DisableHtml() is enabled globally, so the GitHub-style workaround the issue mentions (raw <ul><li> inside a cell) is also unavailable here.
    • docs/syntax/tables.md:40 — the limitation is already documented for authors: "Block-level elements cannot be inserted in a table."
    • src/Elastic.Markdown/Myst/Directives/Table/TableDirectiveBlock.cs:57-90 — the newer {table} directive only adds column-width control; ValidateTableColumnCount still requires exactly one pipe table, so cell content remains inline-only (added in PR #2852, commit 05f168a5). It is not a step toward block content in cells.
    • src/Elastic.Markdown/Myst/Renderers/WrappedTableRenderer.cs:12-18 (wired in src/Elastic.Markdown/Myst/Directives/DirectiveMarkdownExtension.cs:64) — the only table-render customization wraps the table in a scroll <div>; it does not change the cell content model.

    Verdict

    Needs stakeholder input

    The feature is not implemented and there is no scaffolding pointing toward it — pipe-table cells are structurally inline-only and HTML is disabled. Enabling lists in cells is not mechanical: it requires choosing an authoring path, each with real trade-offs, and changing author-facing Markdown capability. That fails the "quick fix" bar (changes author-facing syntax, touches the parser/CSS, alters rendered HTML), so it needs a writer + UX decision before any code is written.

    Proposal

    Open questions, grouped by audience:

    Writer (authoring syntax & migration)

    • Which mechanism do we adopt?
      1. Enable Markdig grid tables (UseGridTables()) — supports lists/blocks in cells, but uses a verbose, different syntax from pipe tables, so authors must learn/maintain two table styles.
      2. Re-allow a narrow set of inline HTML (<ul>/<li>) inside cells — closest to the GitHub workaround, but reverses the global DisableHtml() stance.
      3. A custom directive with block-capable cells (the issue thread floats a "horizontal definition list"; note .UseDefinitionLists() already exists in the pipeline MarkdownParser.cs:188).
    • Do we want lists in every table, or only inside the {table} directive (opt-in, lower blast radius)?

    UX (rendering & layout)

    • How should a list render inside a cell — bullet style, indentation, and behavior within the responsive scroll wrapper (WrappedTableRenderer)?
    • Vertical rhythm/padding when a cell mixes a paragraph and a list.

    Related issues

    Not a duplicate, but part of a tight cluster around the same root cause — pipe-table cells only accept inline content:

    Maintainers may want to plan a single "block content in table cells" workstream covering #508 and #3449 rather than solving each content type separately.

    Notes

    • Suggested label consideration (human decision): a cluster:tables-block-content style grouping across List support in table cells #508 and [Feature Request]: Support for Footnotes or Fancy Callouts in Tables #3449 could help track the shared root cause.
    • The maintainer comment on this issue already outlines a sequencing plan (catalog high-risk tables → fix with existing syntax → gather requirements → build complex-table support, possibly as a horizontal definition list); the "horizontal definition list" idea aligns with option 3 above.
  3. added
    ai-triaged
    ai:writer-question
    ai:ux-question
    on Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-triagedai:ux-questionai:writer-questiontables

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions