For AI agents: the complete documentation index is available at https://a3s-lab.github.io/UI/v0.4.1/llms.txt, the full documentation bundle is available at https://a3s-lab.github.io/UI/v0.4.1/llms-full.txt, and this page is available as Markdown at https://a3s-lab.github.io/UI/v0.4.1/components/table.md.

表格

表格以行列关系呈现可比较的结构化数据,并为标题、排序和紧凑浏览保留清晰语义。

实时预览
最近账单列表
账单状态付款方式金额
INV001已支付信用卡$250.00
INV002待处理PayPal$150.00
INV003未支付银行转账$350.00
INV004已支付Paypal$450.00
INV005已支付信用卡$550.00
INV006待处理银行转账$200.00
INV007未支付信用卡$300.00
合计$2,500.00

用法

引入 CSS

导入 Tailwind 和一个完整的 A3S UI 样式包。

@import "tailwindcss";
@import "@a3s-lab/ui/a3s.css";

或者只导入基本CSS、表格组件CSS和一个样式包。

@import "tailwindcss";
@import "@a3s-lab/ui/base.css";
@import "@a3s-lab/ui/components/table.css";
@import "@a3s-lab/ui/styles/a3s.css";

使用CDN或批量程序导入?请参见安装页。

添加表格 HTML

将 class="table" 添加到您的表元素中。当需要水平滚动时,将其包裹在class="table-container"中。

<div class="table-container">
<table class="table">
  <!-- Content of your table -->
</table>
</div>

示例

下面的示例遵循上游表模式,它们清晰地映射到 A3S UI 的非门户 HTML 模型。

带页脚

实时预览
A list of your recent invoices.
InvoiceStatusMethodAmount
INV001PaidCredit Card$250.00
INV002PendingPayPal$150.00
INV003UnpaidBank Transfer$350.00
Total$2,500.00

带操作

实时预览
ProductPriceActions
Wireless Mouse$29.99
Mechanical Keyboard$129.99
USB-C Hub$49.99

RTL

需要时在表容器上设置 dir="rtl"。使用逻辑对齐工具类,例如 text-end。

实时预览
قائمة الفواتير الأخيرة.
الفاتورةالحالةالمبلغ
INV001مدفوعة$250.00