跳转到内容

Template: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

参见[编辑]