LoginSignup
0
0

More than 1 year has passed since last update.

sphinx: `csv-table`ディレクティブで、行ヘッダ/列ヘッダをコントールする

Last updated at Posted at 2022-01-28

実行環境

  • Python 3.9.7
  • sphinx 4.4.0
    • sphinx theme: alabaster

はじめに

sphinxのcsv-tableディレクティブで、行ヘッダ/列ヘッダをコントールする方法をまとめました。

行ヘッダのコントロール

行ヘッダなし

.. csv-table:: オプションなし

   name,age
   alice,18
   bob,24

image.png

行ヘッダが1つ

headerオプションを指定するか、header-rowsオプションを1にします。

.. csv-table:: headerオプションを指定
   :header: name,age
   
   alice,18
   bob,24


.. csv-table:: header-rowsオプションが1
   :header-rows: 1

   name,age
   alice,18
   bob,24

image.png

行ヘッダが2つ

.. csv-table:: header-rowsオプションが1
   :header-rows: 2

   name,age
   alice,18
   bob,24

image.png

列ヘッダのコントロール

列ヘッダが1つ

.. csv-table:: stub-columns
   :stub-columns: 1

   name,age
   alice,18
   bob,24

image.png

0
0
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
0