跳至內容

模板:Column style

維基百科,自由的百科全書
文件圖示 模板文件[檢視] [編輯] [歷史] [清除快取]

該模板允許在不重複代碼的情況下為表格列應用一些標準樣式。

用法[編輯]

放置{{Column style}}在表格之前,然後在表格的class中加入ts-columnstyle-left-效果参数-列数

列數之前為兩個短橫(ts-columnstyle-left-效果参数--列数)時指定倒數的列數。

效果參數 效果 CSS代碼
left 左對齊 text-align:left;
center 居中對齊 text-align:center;
right 右對齊 text-align:right;
italic 斜體 font-style:italic;
bold 加粗 font-weight:bold;
nowrap 不換行 white-space: nowrap;
increment 自動編號 content: counter(row-num);
small 小號字體 font-size: 85%;
large 大號字體 font-size: large;

示例[編輯]

{{Column style}}
{| class="wikitable ts-columnstyle-bold-2"
! 1 !! 2 !! 3
|-
| 11 || 12 || 13
|-
| 21 || 22 || 23
|-
| 31 || 32 || 33
|}

1 2 3
11 12 13
21 22 23
31 32 33
{{Column style}}
{| class="wikitable sortable ts-columnstyle-increment-1"
! class="unsortable" | № !! 1 !! 2 !! 3
|-
| || 11 || 32 || 13
|-
| || 21 || 22 || 23
|-
| || 31 || 12 || 33
|}

1 2 3
11 32 13
21 22 23
31 12 33

參見[編輯]