# table

URL: /patitas/api/parsing/blocks/table/
Section: blocks
Description: Table parsing for Patitas parser.

Handles GFM (GitHub Flavored Markdown) table parsing.

---

> For a complete page index, fetch /patitas/llms.txt.

Open LLM text
(/patitas/api/parsing/blocks/table/index.txt)

Share with AI

Ask Claude
(https://claude.ai/new?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpatitas%2Fapi%2Fparsing%2Fblocks%2Ftable%2Findex.txt)

Ask ChatGPT
(https://chatgpt.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpatitas%2Fapi%2Fparsing%2Fblocks%2Ftable%2Findex.txt)

Ask Gemini
(https://gemini.google.com/app?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpatitas%2Fapi%2Fparsing%2Fblocks%2Ftable%2Findex.txt)

Ask Copilot
(https://copilot.microsoft.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpatitas%2Fapi%2Fparsing%2Fblocks%2Ftable%2Findex.txt)

Module

#
`parsing.blocks.table`

Table parsing for Patitas parser.

Handles GFM (GitHub Flavored Markdown) table parsing.

1Class

## Classes

`TableParsingMixin`

4

▼

Mixin for GFM table parsing.

Required Host Attributes: None

Required Host Methods:
- _parse_i…

Mixin for GFM table parsing.

Required Host Attributes: None

Required Host Methods:

- _parse_inline(text, location) -> tuple[Inline, ...]

#### Methods

Internal Methods
4

▼

`_parse_inline`

2

`tuple[Inline, ...]`

▼

Parse inline content. Implemented by InlineParsingCoreMixin.

`def _parse_inline(self, text: str, location: SourceLocation) -> tuple[Inline, ...]`

##### Parameters

Name
Type
Description

`text`
`—`

`location`
`—`

##### Returns

`tuple[Inline, ...]`

`_try_parse_table`

2

`Table (/patitas/api/nodes/#Table) | None`

▼

Try to parse lines as a GFM table.

GFM table structure:
| Header 1 | Header 2 …

`def _try_parse_table(self, lines: list[str], location: SourceLocation) -> Table | None`

Try to parse lines as a GFM table.

GFM table structure:

| Header 1 | Header 2 | <- header row
|----------|----------| <- delimiter row (required)
| Cell 1 | Cell 2 | <- body rows

Returns Table if valid, None if not a table.

##### Parameters

Name
Type
Description

`lines`
`—`

`location`
`—`

##### Returns

`Table (/patitas/api/nodes/#Table) | None`

`_parse_table_row`

1

`list[str] | None`

▼

Parse a table row into cells.

Returns list of cell contents, or None if not a …

`def _parse_table_row(self, line: str) -> list[str] | None`

Parse a table row into cells.

Returns list of cell contents, or None if not a valid row.

##### Parameters

Name
Type
Description

`line`
`—`

##### Returns

`list[str] | None`

`_parse_table_delimiter`

2

`tuple[Literal['left', 'c…`

▼

Parse table delimiter row and extract alignments.

Delimiter format: |:---|:---…

`def _parse_table_delimiter(self, line: str, expected_cols: int) -> tuple[Literal['left', 'center', 'right'] | None, ...] | None`

Parse table delimiter row and extract alignments.

Delimiter format: |:---|:---:|---:|
Returns tuple of alignments ('left', 'center', 'right', None).
Returns None if not a valid delimiter row or column count doesn't match.

##### Parameters

Name
Type
Description

`line`
`—`

The delimiter row line

`expected_cols`
`—`

Expected number of columns (from header row)

##### Returns

`tuple[Literal['left', 'center', 'right'] | None, ...] | None`
