Skip to main content

A table block for Wagtail StreamField powered by TinyMCE

License: BSD-3-Clause Ruff PyPI version Build status

Links

TinyTableBlock is a StreamField block powered by TinyMCE and its table plugin.

Wagtail provides TableBlock and TypedTableBlock which are good options if you want basic tables with some cell merging capability or StreamField-powered cell, but they have their limitations:

  • TableBlock is using an old version of handsontable. It doesn't support multi-row header, column headers, nor pasting complex tables.
  • TypedTableBlock gets complex quickly depending on the types of blocks you add, and pasting is limited to single cells.

Wagtail TinyTableBlock (this package) provides the TinyMCE table editor which has improved copy/paste, multi-row and column headers, external link support and more. It does not currently support the Wagtail rich text data format for page and document links, nor does it support embedding images.

Installation

In your project's Django settings, add the app your INSTALLED_APPS list (at the end is fine):

INSTALLED_APPS = [
  # ...
  "wagtail_tinytableblock",
]

Add the TinyTableBlock model to your StreamField definition. For example

# yourapp/models.py
from wagtail.fields import StreamField
from wagtail.models import Page

from wagtail_tinytableblock.blocks import TinyTableBlock


class WonderfulPage(Page):
    body = StreamField([
        # ...
        ("table", TinyTableBlock()),
    ])

Finally, run Django's makemigrations and migrate commands to apply any model field changes to your project

$ python manage.py makemigrations
$ python manage.py migrate

Configuration

TinyTableBlock accepts an allow_links keyword argument which allows enabling the TinyMCE link plugin. Note: this currently only works with external URLs.

from wagtail.blocks import StreamBlock
from wagtail_tinytableblock.blocks import TinyTableBlock

class ContentBlocks(StreamBlock):
    table_block = TinyTableBlock(allow_links=True)

By default, we disable the TinyMCE contextual menu to allow the browser native one. If you want to use TinyMCE one, pass enable_context_menu=True:

from wagtail.blocks import StreamBlock
from wagtail_tinytableblock.blocks import TinyTableBlock

class ContentBlocks(StreamBlock):
    table_block = TinyTableBlock(enable_context_menu=True)

Configuring rich text features allowed in table cells

You can customize which text formatting tools are available inside the table cells. By default, formatting features are turned off to keep table content clean. You can enable them per block or globally across your entire site.

Supported features

The following formatting identifiers can be passed to the configuration arrays:

  • bold
  • italic
  • strikethrough
  • subscript
  • superscript
  • blockquote

Block configuration

To enable per-block configuration, pass a features list directly to the TinyTableBlock definition in your models.py. This aligns directly with standard Wagtail RichTextField formatting controls.

Global configuration (Django settings)

If you want to define a fallback list of formatting features for all tables across your website without repeating the code in every model, define WAGTAIL_TINYTABLE in your settings.py:

# settings.py

WAGTAIL_TINYTABLE = {
    "features": ["bold", "italic", "strikethrough"]
}

Note: If no global settings are defined and no per-block features are provided, the features list defaults to empty ([]), disabling rich text formatting choices completely.

Content Security Policy

For Content Security Policy configuration guidance, follow the TinyMCE documentation with the self-hosted option.

Data representation

The table data is saved as a JSON-serialized dictionary with the following keys:

{
   "headers": [],
   "rows": [],
   "html": the_sanitised_html
}

headers / rows are lists of lists with cell values. Each cell is a dictionary with the following keys

key value notes
value The cell value
type "td" or "th"
rowspan if set
colspan if set
scope if set
align if set

Contributing

All contributions are welcome! See CONTRIBUTING.md

Supported versions:

  • Python 3.12, 3.13, 3.14
  • Django 4.2, 5.2, 6.0
  • Wagtail 6.3 (LTS), 7.0 (LTS), 7.3

Metadata

Release files for wagtail-tinytableblock 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wagtail-tinytableblock 0.5.0
File Size Uploaded Provenance Actions
wagtail_tinytableblock-0.5.0.tar.gz 578.1 kB With provenance Details for wagtail_tinytableblock-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wagtail-tinytableblock 0.5.0
File Interpreter ABI Platform Actions
wagtail_tinytableblock-0.5.0-py3-none-any.whl Python 3 none any Details for wagtail_tinytableblock-0.5.0-py3-none-any.whl

Total release size: 1.2 MB

Release files / wagtail_tinytableblock-0.5.0.tar.gz

Download URL wagtail_tinytableblock-0.5.0.tar.gz
Size 578.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8718142f2e6b01fb7a9f9619a5e420681e03f97ad774eae5c987ae5244da0239
BLAKE2b-256 checksum
How to use checksums
fe17ed97bbc4d2f86bebdd3e081acdaf99f379376e7e37fef5f1f6b7c7009bba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 29, 2026.

Transparency log

Release files / wagtail_tinytableblock-0.5.0-py3-none-any.whl

Download URL wagtail_tinytableblock-0.5.0-py3-none-any.whl
Size 597.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0b2cdb07c1b1de8f6d5dfb9448e710d097f0ff984d6cce97a7d9486eb56a8bea
BLAKE2b-256 checksum
How to use checksums
a20a1ff4bfd110f13ef78c1bcac32c2d87f4d9f46d44174de8be105bf22753fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 29, 2026.

Transparency log

Security for wagtail-tinytableblock 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for wagtail_tinytableblock-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page