ColumnBase

class bootlace.table.ColumnBase(heading: str | T, name: str | None = None)[source]

Bases: ABC

Base class for table columns.

Subclasses must implement the cell() method.

Attributes Summary

attribute

The attribute name for the column.

heading

The heading for the column

name

td

th

Methods Summary

attribute_value(value)

Return the value of the attribute for the given object.

cell(value)

Return the cell for the column as an HTML tag.

contents(value[, format])

Return the contents of the cell for the column, using an HTML comment if the attribute value is None.

Attributes Documentation

attribute

The attribute name for the column.

heading: Heading

The heading for the column

name: str | None
td = Tag(tag=<class 'dominate.tags.td'>, classes=set(), attributes={})
th = Tag(tag=<class 'dominate.tags.th'>, classes=set(), attributes={})

Methods Documentation

attribute_value(value: Any) Any[source]

Return the value of the attribute for the given object.

abstract cell(value: Any) dom_tag[source]

Return the cell for the column as an HTML tag.

contents(value: Any, format: str | None = None) Any[source]

Return the contents of the cell for the column, using an HTML comment if the attribute value is None.