Skip to content

markdown.extensions.tables §

Adds parsing of tables to Python-Markdown.

See the documentation for details.

Classes:

markdown.extensions.tables.TableProcessor(parser: blockparser.BlockParser, config: dict[str, Any]) §

Bases: BlockProcessor

Process Tables.

Methods:

  • test –

    Ensure first two rows (column header and separator row) are valid table rows.

  • run –

    Parse a table block and build table.

markdown.extensions.tables.TableProcessor.test(parent: etree.Element, block: str) -> bool §

Ensure first two rows (column header and separator row) are valid table rows.

Keep border check and separator row do avoid repeating the work.

markdown.extensions.tables.TableProcessor.run(parent: etree.Element, blocks: list[str]) -> None §

Parse a table block and build table.

markdown.extensions.tables.TableExtension(**kwargs) §

Bases: Extension

Add tables to Markdown.

Methods:

Attributes:

  • config –

    Default configuration options.

markdown.extensions.tables.TableExtension.config instance-attribute §

Default configuration options.

Defined Value:

self.config = {
    'use_align_attribute': [False, 'True to use align attribute instead of style.'],
}

markdown.extensions.tables.TableExtension.extendMarkdown(md) §

Register the processor.

Class Instance Registry Name Priority
TableProcessor blockprocessors table 75