在 Markdown 中创建一个没有标题的表格 [英] Create a table without a header in Markdown
问题描述
是否可以在 Markdown 中创建没有标题的表格?
Is it possible to create a table without a header in Markdown?
HTML 看起来像这样:
The HTML would look like this:
<table>
<tr>
<td>Key 1</td>
<td>Value 1</td>
</tr>
<tr>
<td>Key 2</td>
<td>Value 2</td>
</tr>
</table>
推荐答案
大多数 Markdown 解析器不支持没有标题的表格.这意味着标题的分隔线是强制性的.
Most Markdown parsers don't support tables without headers. That means the separation line for headers is mandatory.
- multimarkdown
- Maruku:Ruby 中的一种流行实现
- byword:所有表格必须以一行或多行标题开头"
PHP Markdown Extra "第二行包含一个必填项标题和内容之间的分隔线"
- multimarkdown
- Maruku: A popular implementation in Ruby
- byword: "All tables must begin with one or more rows of headers"
PHP Markdown Extra "second line contains a mandatory separator line between the headers and the content"
RDiscount 使用 PHP Markdown Extra 语法.p>
RDiscount Uses PHP Markdown Extra syntax.
- Kramdown:Ruby 中的解析器
- Text::MultiMarkdown:Perl CPAN 模块.
- MultiMarkdown:Windows 应用程序.
- ParseDown Extra:PHP 中的解析器.
- Pandoc:用 Haskell 编写的命令行文档转换器(通过其
支持无头表simple_tables
和multiline_tables
扩展) - Flexmark:Java 中的解析器.
- Kramdown: A parser in Ruby
- Text::MultiMarkdown: Perl CPAN module.
- MultiMarkdown: Windows application.
- ParseDown Extra: A parser in PHP.
- Pandoc: A document converter for the command line written in Haskell (supports header-less tables via its
simple_tables
andmultiline_tables
extensions) - Flexmark: A parser in Java.
如果您能够更改 HTML 输出的 CSS,那么您可以利用 :empty
伪类来隐藏空标题并使其看起来根本没有标题.
If you're able to change the CSS of the HTML output you can however leverage the :empty
pseudo class to hide an empty header and make it look like there is no header at all.
这篇关于在 Markdown 中创建一个没有标题的表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!