Skip to content

Let authors choose which columns get dropdowns in a :filterable: table #4914

Open

Description

@nastasha-solomon

Problem

The {table} directive's :filterable: option (added in #4130) adds a dropdown filter to every column that has 2 to 12 distinct values. That works well for type and status columns. It doesn't work for columns of scores or counts, which also have few distinct values.

I hit this on the Security LLM performance matrix in elastic/docs-content#9483. Each row is a model, and most columns are capability scores from 1 to 10:

  • The proprietary-models table gets seven dropdowns, one for each Agent Builder sub-score.
  • The open-source table gets eight, because its Overall Agent Builder Score column has exactly 12 distinct values.

Each dropdown can only match one exact score, such as "9.00". A reader comparing models wants "8 or higher," not "exactly 9.00." The controls also stack in several rows above the table before any data shows, because the labels are long ("Agent Builder: Alert Analysis").

As an author, I can't turn the dropdowns off, and I can't choose the one column that would be useful, such as the model provider.

Proposal

Two directive options that hand the choice to the author. Tables that use a bare :filterable: keep today's behavior.

  • :filterable: search adds the search box and the "Showing N of M" count, with no dropdown filters.
  • :filter-columns: Provider, Type names the only columns that get a dropdown, matched by header text. A listed column gets a dropdown however many distinct values it has, and a name that matches no header fails the build.
:::{table}
:matrix:
:filterable:
:filter-columns: Provider

| Provider | Model | Alert analysis | Threat hunting |
| --- | --- | --- | --- |
| Anthropic | Claude Opus 5 | 9.00 | 9.00 |
:::

Why not skip numeric columns automatically

It would fix this table, but it would also remove dropdowns that help. A version column with values like 9.2 and 9.3 looks numeric and is a useful filter. Letting the author choose avoids guessing.

Related

When a column of numbers does get a dropdown, its options sort as text, so "10.00" comes before "4.00". The proposal above doesn't change that.

Activity

  1. nastasha-solomon commented on Nov 18, 2026

    @nastasha-solomon
    MemberAuthor

    While working on #4915, I made two improvements beyond the options this issue proposes. Both make :filter-columns: safer for writers to use.

    Column names match what readers see

    :filter-columns: matches names against the header text that appears on the page. Capital letters, extra spaces, bold or italic text, and footnote markers don't matter, and a header that uses a substitution variable matches the variable's value. A writer copies the header as it reads on the page, and it works.

    The first version compared header text in two places, in the build and again in the browser, and the two could disagree. A header with a footnote passed the build check, then quietly got no dropdown. Now only the build compares names, and it tells the browser which columns to filter by position. A name either works or fails the build with a clear error.

    Mistakes fail the build instead of failing quietly

    Before, a value such as :filterable: yes turned filtering off without any message. Now the build reports these mistakes:

    • A :filter-columns: name that matches no column header. The error lists the headers you can use.
    • A :filterable: value other than search, true, or false.
    • :filter-columns: without :filterable:, which is a warning.
    • Both :filterable: search and :filter-columns:, which conflict.

    Writers find out while they're writing, not when a reader reports a missing filter.

    Related work

    Testing on real tables also showed that the controls above filterable tables were hard to use with several dropdowns. I split that work into its own issue and PR, so this one stays focused:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions