# 编辑具有空标题的表格时，会将它们填充为默认文本（“列A”、“列B”……）

**URL:** https://meta.discourse.org/t/editing-a-table-with-empty-headers-fills-them-in-with-the-default-text-column-a-column-b/268472
**Category:** Bug
**Tags:** table-builder, fixed
**Created:** [2023年六月15日 13:17 UTC](https://meta.discourse.org/t/editing-a-table-with-empty-headers-fills-them-in-with-the-default-text-column-a-column-b/268472 "2023-06-15T13:17:34Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [2023年六月15日 13:17 UTC](https://meta.discourse.org/t/editing-a-table-with-empty-headers-fills-them-in-with-the-default-text-column-a-column-b/268472/1 "2023-06-15T13:17:34Z")

</div>

我注意到，当我使用此工具编辑表格时，它会为没有标题的表格添加带字母的标题——然后我必须手动删除它们。例如，如果您在此处使用此功能编辑 GitHub 存储库主题表格（它们从不带标题），它会添加 A、B 和 C 标题。这是不必要的，只有在需要时用户才应添加标题。编辑后必须手动从表格代码中删除字母。

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [2023年六月15日 14:57 UTC](https://meta.discourse.org/t/editing-a-table-with-empty-headers-fills-them-in-with-the-default-text-column-a-column-b/268472/2 "2023-06-15T14:57:04Z")

</div>

我能重现 😺

在我的情况下，它还会复制表格…… 🤔

你遇到过复制的情况吗 @Lillinator？

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [2023年六月15日 14:59 UTC](https://meta.discourse.org/t/editing-a-table-with-empty-headers-fills-them-in-with-the-default-text-column-a-column-b/268472/3 "2023-06-15T14:59:36Z")

</div>

> [@Canapin](#):
>
> 你也遇到了重复的问题吗 @Lilly？

我也遇到了，但我以为是我自己弄错了，哈哈。我现在又重现了这个问题。

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [2023年六月15日 15:01 UTC](https://meta.discourse.org/t/editing-a-table-with-empty-headers-fills-them-in-with-the-default-text-column-a-column-b/268472/4 "2023-06-15T15:01:09Z")

</div>

显然，有两个不同的错误。我尝试在手动填写表头后编辑表格，但它仍然重复了。正在寻找一致的重现（或查看是否有不会重现重复的条件）。

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [2023年六月15日 15:02 UTC](https://meta.discourse.org/t/editing-a-table-with-empty-headers-fills-them-in-with-the-default-text-column-a-column-b/268472/5 "2023-06-15T15:02:16Z")

</div>

我遇到了一些奇怪的问题。它复制了表格，但随后又消失了。

在我的网站上，我无法重现重复的表格，但我确实遇到了插入标题的问题。

我尝试在 Meta 上编辑 3 个不同的表格，并在其中一个表格上短暂地看到了重复的表格。非常奇怪。

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [2023年六月15日 15:09 UTC](https://meta.discourse.org/t/editing-a-table-with-empty-headers-fills-them-in-with-the-default-text-column-a-column-b/268472/6 "2023-06-15T15:09:18Z")

</div>

我个人认为，除了修复标题插入错误之外，当我们使用表格生成器时，应该可以选择删除标题行或将其留空，这与删除表格行类似。

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2023年六月15日 23:02 UTC](https://meta.discourse.org/t/editing-a-table-with-empty-headers-fills-them-in-with-the-default-text-column-a-column-b/268472/7 "2023-06-15T23:02:27Z")

</div>

谢谢 @Lilly … 我将为此添加 #pr-welcome！

---

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [2024年七月12日 16:44 UTC](https://meta.discourse.org/t/editing-a-table-with-empty-headers-fills-them-in-with-the-default-text-column-a-column-b/268472/9 "2024-07-12T16:44:32Z")

</div>

这个 PR 应该能解决这个问题 🙂

> <https://github.com/discourse/discourse/pull/27894>
>
> The old table builder would fill empty headers with default values A~Z when edit…ing. This commit makes table-builder respect the old empty headers.
> 
> This is due to a behavior of jspreadsheet that cannot be turned off (see https://bossanova.uk/jspreadsheet/v4/docs/getting-started#Header-titles ). We have to pass in a value that cannot be implicitly converted to false in the JavaScript sense. In this case, we pass in a space, which is the same as the empty string in the visual sense.
> 
> before: 
> 
> The table-builder will fill the empty header with the default values ​​of A~Z and save it.
> 
> after:
> 
> Allows an empty header (strictly speaking, it is a space \`" "\`)
> 
> !\[image\](https://github.com/user-attachments/assets/7b9d72ce-92a4-4959-ac09-2d164d45a80d)
> 
> 
> related meta topic: https://meta.discourse.org/t/editing-a-table-with-empty-headers-fills-them-in-with-the-default-text-column-a-column-b/268472

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [2024年七月15日 07:00 UTC](https://meta.discourse.org/t/editing-a-table-with-empty-headers-fills-them-in-with-the-default-text-column-a-column-b/268472/10 "2024-07-15T07:00:37Z")

</div>

此主题已在 2 天后自动关闭。不再允许回复。
