CheckColumn

class bootlace.table.CheckColumn(heading: str | ~bootlace.util.T, name: str | None = None, yes: ~bootlace.icon.Icon = Icon(name='check', svg=Tag(tag=<class 'dominate.svg.svg'>, classes={'align-self-center', 'bi-inline', 'me-1', 'bi', 'pe-none'}, attributes={'role': 'img', 'fill': 'currentColor', 'width': '16', 'height': '16'}), use=Tag(tag=<class 'dominate.svg.use'>, classes=set(), attributes={})), no: ~bootlace.icon.Icon = Icon(name='x', svg=Tag(tag=<class 'dominate.svg.svg'>, classes={'align-self-center', 'bi-inline', 'me-1', 'bi', 'pe-none'}, attributes={'role': 'img', 'fill': 'currentColor', 'width': '16', 'height': '16'}), use=Tag(tag=<class 'dominate.svg.use'>, classes=set(), attributes={})))[source]

Bases: ColumnBase

A column which shows a checkmark or X based on the value of the attribute.

Attributes Summary

attribute

The attribute name for the column.

heading

The heading for the column

name

no

The icon for a false value

td

th

yes

The icon for a true value

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
no: Icon

The icon for a false value

td = Tag(tag=<class 'dominate.tags.td'>, classes=set(), attributes={})
th = Tag(tag=<class 'dominate.tags.th'>, classes=set(), attributes={})
yes: Icon

The icon for a true value

Methods Documentation

attribute_value(value: Any) Any

Return the value of the attribute for the given object.

cell(value: Any) dom_tag[source]

Return the cell for the column as an HTML tag.

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

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