Rust UI component that displays a table with header, body and footer.
table
- Copy Demo
Invoice | Status | Method | Amount |
---|---|---|---|
INV001 | Paid | Credit Card | $250.00 |
INV002 | Pending | PayPal | $150.00 |
INV003 | Unpaid | Bank Transfer | $350.00 |
INV004 | Paid | Credit Card | $450.00 |
INV005 | Paid | PayPal | $550.00 |
INV006 | Pending | Bank Transfer | $200.00 |
INV007 | Unpaid | Credit Card | $300.00 |
Total | $2,500.00 |
Installation
You can run either of the following commands:
# cargo install ui-cli --forceui add demo_tableui add table
Update the imports to match your project setup.
Usage
use crate::components::ui::table::{
Table,
TableBody,
TableCaption,
TableCell,
TableFooter,
TableHead,
TableHeader,
TableRow,
};
<Table>
<TableCaption>"Table Caption"</TableCaption>
<TableHeader>
<TableRow>
<TableHead>"Header 1"</TableHead>
<TableHead>"Header 2"</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow>
<TableCell>"Cell 1"</TableCell>
<TableCell>"Cell 2"</TableCell>
</TableRow>
</TableBody>
</Table>