在 Markdown 中创建一个没有标题的表格 [英] Create a table without a header in Markdown

查看:131
本文介绍了在 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: 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>

  • GitHub Flavored Markdown
  • Parsedown:PHP 中的解析器(例如在 Laravel 电子邮件中使用)
  • RDiscount Uses PHP Markdown Extra syntax.

    • 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 and multiline_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屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆