Table Component Samples

Basic Table

Header 1 Header 2 Header 3 Cell 1 Cell 2 Cell 3 Cell 4 Cell 5 Cell 6
<Table>
    <TableRow>
        <TableHeaderCell>Header 1</TableHeaderCell>
        <TableHeaderCell>Header 2</TableHeaderCell>
    </TableRow>
    <TableRow>
        <TableCell>Cell 1</TableCell>
        <TableCell>Cell 2</TableCell>
    </TableRow>
</Table>

Table with Caption

Product Price Widget $10.00 Gadget $25.00
<Table Caption="Product List">
    ...
</Table>

Table with Grid Lines

Name Age City Alice 30 New York Bob 25 Los Angeles
<Table GridLines="GridLines.Both" CellPadding="5">
    ...
</Table>

Cell Spanning

Full Width Header Spans 2 Rows Cell 1 Cell 2 Cell 3 Cell 4
<TableHeaderCell ColumnSpan="3">Full Width Header</TableHeaderCell>
<TableCell RowSpan="2">Spans 2 Rows</TableCell>

Table with Styling

Column A Column B Centered Top Aligned Alternating Row Color
<Table BackColor="new WebColor(System.Drawing.Color.WhiteSmoke)"
       BorderStyle="BorderStyle.Solid"
       CellPadding="10">
    <TableRow BackColor="new WebColor(System.Drawing.Color.LightBlue)">
        <TableHeaderCell>Column A</TableHeaderCell>
    </TableRow>
    <TableRow>
        <TableCell HorizontalAlign="HorizontalAlign.Center">Centered</TableCell>
    </TableRow>
</Table>

Accessible Table with Header Scope

Product Q1 Q2 Widgets 100 150 Gadgets 200 175
<TableHeaderCell Scope="TableHeaderScope.Column">Product</TableHeaderCell>
<TableHeaderCell Scope="TableHeaderScope.Row">Widgets</TableHeaderCell>