Table

Tags for tables

class disseminate.tags.table.BaseTable(*args, **kwargs)

Bases: disseminate.tags.tag.Tag

A base tag for all tables

html_fmt(content=None, attributes=None, format_func='html_fmt', method='html', level=1, **kwargs)

Convert the tag to an html string or html element.

Parameters
contentOptional[Union[str, List[Union[str, list, Tag]]]

Specify an alternative content from the tag’s content. It can either be a string, a tag or a list of strings, tags and lists.

attributesOptional[Union[str, Attributes]]

Specify an alternative attributes dict from the tag’s attributes. It can either be a string or an attributes dict.

format_funcOptional[str]

The format function to use with by formatted_content when formatting sub-tags.

methodOptional[str]

The rendering method for the string. ex: ‘html’ or ‘xml’

levelOptional[int]

The level of the tag.

Returns
htmlstr or html element

A string in HTML format or an HTML element (lxml.builder.E).

tex_fmt(content=None, attributes=None, mathmode=False, level=1, **kwargs)

Format the tag in LaTeX format.

Parameters
contentOptional[Union[str, List[Union[str, list, Tag]]]

Specify an alternative content from the tag’s content. It can either be a string, a tag or a list of strings, tags and lists.

attributesOptional[Union[str, Attributes]]

Specify an alternative attributes dict from the tag’s attributes. It can either be a string or an attributes dict.

mathmodeOptional[bool]

If True, the tag will be rendered in math mode. Otherwise (default) latex text mode is assumed.

levelOptional[int]

The level of the tag.

Returns
tex_stringstr

The formatted tex string.

xhtml_fmt(format_func='xhtml_fmt', method='xhtml', **kwargs)

Convert the tag to an xhtml string or html element.

Returns
xhtmlstr or xhtml element

A string in XHTML format or an XHTML element ( lxml.builder.E).

class disseminate.tags.table.FullTable(*args, **kwargs)

Bases: disseminate.tags.table.BaseTable

The @fulltable tag

class disseminate.tags.table.MarginTable(*args, **kwargs)

Bases: disseminate.tags.table.BaseTable

The @margintable tag

class disseminate.tags.table.Table(*args, **kwargs)

Bases: disseminate.tags.table.BaseTable

The @table tag