mdx-formatter
GitHub リポジトリ

検索したい単語を入力

いつでも検索バーを開ける

これは旧バージョンのドキュメントです。最新バージョンを見る

Tables

このページはまだ翻訳されていません。原文のまま表示しています。

How the formatter handles GFM tables and HTML tables

GFM (pipe-style) tables are preserved as-is. The formatter does not modify GFM table alignment or padding. HTML tables are handled by the formatHtmlBlocksInMdx option.

Rules

  • GFM (pipe-style) tables are preserved as-is

  • The formatter does not modify GFM table alignment or padding

Examples

HTML table indentation

HTML tables in MDX are formatted by the formatHtmlBlocksInMdx rule:

Before:

<table>
<thead>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>Data 1</td>
<td>Data 2</td>
</tr>
</tbody>
</table>

After:

<table>
  <thead>
    <tr>
      <th>Header 1</th>
      <th>Header 2</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Data 1</td>
      <td>Data 2</td>
    </tr>
  </tbody>
</table>