Skip to main content

Table

ty-table

The ty-table component serves as a container for table rows and columns, offering flexible layout and styling options.

Usage

Live Editor
<ty-table>
    <ty-table-head>                            
        <ty-table-head-cell width="30%">Column 1</ty-table-head-cell>
        <ty-table-head-cell width="30%">Column 2</ty-table-head-cell>
        <ty-table-head-cell width="39%" align="center">Column 3</ty-table-head-cell>
        <ty-table-head-cell width="1%"> Actions </ty-table-head-cell>
    </ty-table-head>
    <ty-table-body>
    <ty-table-row>                
        <ty-table-cell>Row 1, Cell 1</ty-table-cell>
        <ty-table-cell>Row 1, Cell 2</ty-table-cell>
        <ty-table-cell>Row 1, Cell 3</ty-table-cell>
        <ty-table-cell>  
            <ty-button variant="icon">
            <span class="material-icons md-18">more_vert</span>
            </ty-button>
        </ty-table-cell>
    </ty-table-row>
    <ty-table-row>                
        <ty-table-cell>Row 2, Cell 1</ty-table-cell>
        <ty-table-cell>Row 2, Cell 2</ty-table-cell>
        <ty-table-cell>Row 2, Cell 3</ty-table-cell>
        <ty-table-cell>  
            <ty-button variant="icon">
            <span class="material-icons md-18">more_vert</span>
            </ty-button>
        </ty-table-cell>
    </ty-table-row>                   
    </ty-table-body>
</ty-table>
Result
Loading...

Children Components

ComponentDescription
ty-table-head-cellRepresents individual header cells in the table.
ty-table-bodyRepresents the body of the table, containing data rows.
ty-table-rowRepresents individual rows in the table.
ty-table-cellRepresents individual cells within a row.

Properties

NameDescriptionTypeDefault
alignSets the text alignment.'left' | 'center' | 'right''left'
widthDefines the cell width.String (px, %, etc.)'auto'