Class TwTable
- Namespace
- TwBlazor.Components
- Assembly
- TwBlazor.dll
Represents a customizable table component for Blazor applications that enables rendering of table headers, body, and footers with configurable styling and behaviour.
public class TwTable : TwBlazorComponentBase, IComponent, IHandleEvent, IHandleAfterRender, ITwComponent
- Inheritance
-
TwTable
- Implements
- Inherited Members
Remarks
The TwTable component provides flexibility for displaying tabular data by allowing developers to supply custom content for the header, body, and footer sections using RenderFragment parameters. It supports additional styling options such as striped rows, hover effects, and borders, which can be controlled through component parameters. Additional CSS classes can be applied to each section for further customization. This component is intended to be used as a building block for creating accessible and visually consistent tables in Blazor projects.
Constructors
TwTable()
public TwTable()
Properties
BodyClass
Additional CSS classes for the body section.
[Parameter]
public string? BodyClass { get; set; }
Property Value
Bordered
Whether to show borders on all cells.
[Parameter]
public bool Bordered { get; set; }
Property Value
Caption
Optional caption content for the table, rendered as a <caption> element. Provides an accessible
name/description for the table that is programmatically associated with it. Visually hidden by default
(via the sr-only class) unless CaptionVisible is set to true.
[Parameter]
public RenderFragment? Caption { get; set; }
Property Value
CaptionVisible
Whether the Caption should be visible. Defaults to false, rendering the caption
visually hidden (but still available to assistive technology).
[Parameter]
public bool CaptionVisible { get; set; }
Property Value
FooterClass
Additional CSS classes for the footer section.
[Parameter]
public string? FooterClass { get; set; }
Property Value
HeaderClass
Additional CSS classes for the header section.
[Parameter]
public string? HeaderClass { get; set; }
Property Value
Hoverable
Whether to show hover effect on rows.
[Parameter]
public bool Hoverable { get; set; }
Property Value
NoBorder
Whether to hide the outer table border.
[Parameter]
public bool NoBorder { get; set; }
Property Value
Striped
Whether to show striped rows.
[Parameter]
public bool Striped { get; set; }
Property Value
TableBody
Content to render in the table body (tbody).
[Parameter]
public RenderFragment? TableBody { get; set; }
Property Value
TableFooter
Content to render in the table footer (tfoot).
[Parameter]
public RenderFragment? TableFooter { get; set; }
Property Value
TableHeader
Content to render in the table header (thead).
[Parameter]
public RenderFragment? TableHeader { get; set; }
Property Value
Methods
BuildRenderTree(RenderTreeBuilder)
Renders the component to the supplied RenderTreeBuilder.
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builderRenderTreeBuilder