---
title: "表格字段示例"
description: "填写表格字段并添加或删除正文行，同时保持表头和列固定。"
canonical_url: "https://tiptap.zhcndoc.com/composable-docs/slots/examples/table-fields"
---

# 表格字段示例

填写表格字段并添加或删除正文行，同时保持表头和列固定。

此示例使用[内容保护](https://tiptap.zhcndoc.com/composable-docs/content-protection/getting-started/overview.md)限制用户可以编辑的内容。用户可以向表格添加和删除行并编辑其中的内容，但不能编辑表格外的内容、添加列或编辑表头。

此演示使用 Slots 将表格单元格定义为字段：每个表格字段都包含一个可以填入内容并在之后验证的 Slot。

> **Interactive demo:** [TableFields](https://embed-pro.tiptap.dev/preview/Examples/TableFields)
