# 在主题中居中一行

**URL:** https://meta.discourse.org/t/center-a-line-in-a-topic/127354
**Category:** Support
**Created:** [2019年九月1日 21:52 UTC](https://meta.discourse.org/t/center-a-line-in-a-topic/127354 "2019-09-01T21:52:38Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![verilog15](https://avatars.discourse-cdn.com/v4/letter/v/9f8e36/32.png) [@verilog15](https://meta.discourse.org/u/verilog15)
#### Post date: [2019年九月1日 21:52 UTC](https://meta.discourse.org/t/center-a-line-in-a-topic/127354/1 "2019-09-01T21:52:38Z")

</div>

不久前，我看到一个插件，它通过 `[center][\center]` 添加了一个居中对齐按钮。但现在我似乎找不到它了。能否帮我指一下那个帖子？  
谢谢 🙂

---

<div class="post-metadata">

### Author: ![smrtey](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@smrtey](https://meta.discourse.org/u/smrtey)
#### Post date: [2019年九月2日 02:08 UTC](https://meta.discourse.org/t/center-a-line-in-a-topic/127354/2 "2019-09-02T02:08:44Z")

</div>

[**官方** BBCode 插件](https://meta.discourse.org/t/discourse-bbcode/65425) 允许您使用 center 标签。不确定它是否有按钮，但如果没有，[格式化工具栏插件](https://meta.discourse.org/t/formatting-toolbar/40649) 会为您提供一个按钮。

---

<div class="post-metadata">

### Author: ![Steven](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven/32/187890_2.png) [@Steven](https://meta.discourse.org/u/Steven)
#### Post date: [2019年九月2日 11:53 UTC](https://meta.discourse.org/t/center-a-line-in-a-topic/127354/3 "2019-09-02T11:53:23Z")

</div>

如果您不想或无法安装插件，我还创建了一个包含几个按钮的主题组件

> [@MD Composer extras](https://meta.discourse.org/t/md-composer-extras/118912):
>
> This theme component adds few formatting options in the composer : underline, align center, align right, justify and strikethrough. You can customize the text of each button in the settings, making it compatible with every languages. Exist in rtl version (change align right to align left).

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2023年三月28日 01:02 UTC](https://meta.discourse.org/t/center-a-line-in-a-topic/127354/4 "2023-03-28T01:02:45Z")

</div>



---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [2023年三月28日 01:15 UTC](https://meta.discourse.org/t/center-a-line-in-a-topic/127354/5 "2023-03-28T01:15:12Z")

</div>

有点作弊，但可以这样做：

| 居中！ |
| --- |

是的，非常作弊 🤣

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [2023年三月28日 03:27 UTC](https://meta.discourse.org/t/center-a-line-in-a-topic/127354/6 "2023-03-28T03:27:59Z")

</div>

用表格绘画，嗯？

这让我想起了那个更简单的时代，在拨号上网的连接上用记事本手工编写 HTML。那时时间_确实_是金钱。

有了 `rowspan` 和 `colspan` 的一点帮助，_任何事情_都是可能的。

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [2023年三月28日 03:31 UTC](https://meta.discourse.org/t/center-a-line-in-a-topic/127354/7 "2023-03-28T03:31:12Z")

</div>

在手机上看起来好多了：

> ![Screenshot_2023-03-27-23-29-54-19_3aea4af51f236e4932235fdada7d1643](https://global.discourse-cdn.com/meta/original/4X/1/7/c/17c1416418862d5d9025a61a0f1db0f80efbe05a.jpeg)

相比之下，桌面版：

> ![image](https://global.discourse-cdn.com/meta/original/4X/a/2/4/a241479ca1ff59a463b428182a88b13e220cdb2e.png)

---

<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: [2023年四月29日 12:36 UTC](https://meta.discourse.org/t/center-a-line-in-a-topic/127354/8 "2023-04-29T12:36:57Z")

</div>


