Skip to content

Available Built-in Formatters

ActionsFormatter

Renders a template snippet to display row-level actions.

Options
  • template (str): The path to the template to render. Defaults to tables/formatters/actions.html.

BooleanFormatter

Renders a boolean value as 'Yes' or 'No'.

DateFormatter

Formats a datetime string into a more readable date.

Options
  • date_format (str): The strftime format for the output. Defaults to "%d/%m/%Y - %H:%M".

JsonDisplayFormatter

Renders a JSON object using a template snippet for display.

Must be combined with tabulator_formatter="html" in the ColumnDefinition to ensure proper HTML rendering in the frontend.

ListFormatter

Renders a list as a comma-separated string.

NoneAsEmptyFormatter

Renders a None value as an empty string.

TextBoldFormatter

Renders text in bold.

TrimStringFormatter

Trims a string to a specified maximum length.

Options
  • max_length (int): The maximum length of the string. Defaults to 79.
  • add_ellipsis (bool): Whether to add "..." if the string is trimmed. Defaults to True.

UserLinkFormatter

Generates a link to a user's profile with a placeholder avatar.

This is a custom, performant implementation that avoids expensive user_show calls for every row by using a placeholder. The value for this formatter should be a user ID.

Options
  • maxlength (int): Maximum length of the user's display name. Defaults to 20.
  • avatar (int): The size of the avatar placeholder in pixels. Defaults to 20.