テンプレート:Div col/doc

提供:日本TW架空国家WIKI

<templatestyles></templatestyles>

テンプレート:CSS3 multiple column layout {{Div col}} は、{{div col end}} とともに用いて、リストを段組みで表示するテンプレートです。設定で小さなフォントサイズで表示できます。

使い方

引数

|cols=
列の数を指定します。既定値は2です。
非推奨。下の colwidth の方が閲覧環境に応じて柔軟に対応できるため。18em未満にはなりません。
|colwidth=
列の幅を指定します。cols を上書きします。px, em, % といった単位を付けます。
|small=
yes と指定することで、フォントサイズを小さく (90%) します。
|rules=
列の間に垂直線を書きます。yes と指定するか、あるいは、(1px dashed blue; のような)CSSのスタイルを指定します。
|gap=
隣接した列の内容の間のスペースを指定します。(ブラウザによって設定されている)既定値は1emです。
|style=
列に適用するCSSスタイル。

使用例

何も指定しないと、2列か18emで幅が大きい方になります。

{{Div col}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}

表示

  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h

cols= は省略できます。

{{Div col|3}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}

表示

  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h

colwidth= は省略できます。第二引数であることに注意します。

{{Div col||10em}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}

表示

  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h

small=yes で文字サイズが小さくなります。

{{Div col|small=yes}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}

表示

  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h

rules の例

{{Div col|rules=yes}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}

表示

  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h

gap の例

{{Div col|colwidth=10em|rules=yes|gap=2em}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}

表示

  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h

技術的な詳細

このテンプレートは以下のCSSのプロパティに対応したブラウザでマルチカラムを作成します。

TemplateData

これは新しいビジュアルエディターにより使用されるテンプレートのためのTemplateData文書です。

Div col

Breaks a list into columns. It automatically breaks each column to an equal space, so you do not manually have to find the half way point on two columns. The list is provided by |content= or closed with {{div col end}}.

テンプレートパラメーター

パラメーター説明状態
colscols 1

Specifies the number of columns.

既定
2
数値非推奨
colwidthcolwidth 2

Specifies the width of columns, and determines dynamically the number of columns based on screen width; more columns will be shown on wider displays. This overrides the 'cols' setting.

文字列省略可能
rulesrules

Produces vertical rules between the columns if set to yes.

文字列省略可能
gapgap

Specifies the space between the content of adjacent columns.

文字列省略可能
stylestyle

Specifies any custom styling.

文字列省略可能
contentcontent

Specifies the content.

文字列省略可能

関連項目

テンプレート:Column-generating template families