0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【Markdown】【表】【列見出し】1列目を見出しにしたい

Posted at

はじめに

 Markdown(正確にはその方言)の表の書き方は、一行目を見出しとします。しかし、まれに一列目を見出しにしたい場合があります。

 『Markdown』『表』『列見出し』で検索すると、「HTML で書く」「** を使って太字にする」などの方法が出てきます。

「ソンナワケナイジャン...」

 この記事でも、まあ HTML を利用するのですが、もう少し労力を軽減する方法を提案します。

サンプル

 対象の表を <div> タグで括り、その中の <table> に対してスタイルシートを適用します。

<style>
    div.vheader table tr th
    {
        visibility: collapse;
    }

    div.vheader table tr td:nth-of-type(1)
    {
        text-align: right;
        font-weight: bold;
    }
</style>

<div class='vheader'>

属性    |属性値
-------|----------
ID     |123-456
Name   |佐藤太郎
Age    |25
Section|人事総務部

</div>

終わりに

 VS Code のプレビュー機能では使えますが、「Qiita」では使えないようですね。残念。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?