darshan-rajadhyaksha

Table

Footers

About

A styled HTML table system (table, head, body, row, cell, footer) that supports dense layouts, selected rows, and per-cell text alignment, with cells automatically rendering as th or td based on context.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Table to your project and fits it to your theme.

Code

How Table is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import Table, {
  TableBody,
  TableCell,
  TableFooter,
  TableHead,
  TableRow,
} from "@/components/ui/table";

const orders = [
  { product: "Wireless Headphones", quantity: 2, total: "$398.00" },
  { product: "Mechanical Keyboard", quantity: 1, total: "$149.00" },
  { product: "USB-C Hub", quantity: 3, total: "$267.00" },
];

export default function TableFooterDemo() {
  const total = orders.reduce(
    (sum, order) => sum + Number(order.total.replace("$", "")),
    0,
  );

  return (
    <Table>
      <TableHead>
        <TableRow>
          <TableCell>Product</TableCell>
          <TableCell align="right">Quantity</TableCell>
          <TableCell align="right">Total</TableCell>
        </TableRow>
      </TableHead>
      <TableBody>
        {orders.map((order) => (
          <TableRow key={order.product}>
            <TableCell>{order.product}</TableCell>
            <TableCell align="right">{order.quantity}</TableCell>
            <TableCell align="right">{order.total}</TableCell>
          </TableRow>
        ))}
      </TableBody>
      <TableFooter className="bg-neutral-100 dark:bg-neutral-900">
        <TableRow>
          <TableCell className="font-semibold">Total</TableCell>
          <TableCell align="right" className="font-semibold">
            {orders.reduce((sum, order) => sum + order.quantity, 0)}
          </TableCell>
          <TableCell align="right" className="font-semibold">
            ${total.toFixed(2)}
          </TableCell>
        </TableRow>
      </TableFooter>
    </Table>
  );
}

Dependencies

More by darshan-rajadhyaksha

View all
  • Backdrop

    Backdrop

    1
  • Card Content

    Card Content

  • Breadcrumbs

    Breadcrumbs

  • Checkbox

    Checkbox

  • Textarea

    Textarea

  • Card Title

    Card Title

  • Accordion

    Accordion

  • Tabs Context

    Tabs Context

More in Footers

View all
  • Footer section

    Footer section

    1.9K
  • Footer 7

    Footer 7

    555
  • Large Name Footer

    Large Name Footer

    193
  • Footer

    Footer

    446
  • Footer column

    Footer column

    426
  • Stacked Circular Footer

    Stacked Circular Footer

    413
  • Footer 2

    Footer 2

    201
  • Footer

    Footer

    80