Bản mẫu:Danh sách cột

Bách khoa toàn thư mở Wikipedia
(Đổi hướng từ Bản mẫu:Columns-list)
Tài liệu bản mẫu[xem] [sửa] [lịch sử] [làm mới]

This template is for use in a list in the body of an article, rather than in a navigation template like Bản mẫu:Hộp điều hướng. Based on Bản mẫu:Tham khảo, but different in that the text to be displayed is manually created rather than a list of references.

Sử dụng[sửa mã nguồn]

The width of each column may be specified using |colwidth= and a value in ems.

{{columns-list|colwidth=width|
Text (usually a list)
}}

Here, width specifies the width of the columns, and determines dynamically the number of columns based on screen width; more columns will be shown on wider displays.

If |colwidth= is not specified, the default width of 30em will be used.

This template uses CSS3 multiple-column layout, which is not supported by all Web browsers.

CSS3 multiple-column layout
browser support
Thuộc tính Internet
Explorer
Firefox Safari Chrome Opera
≤ 9 ≤ 1.0 ≤ 2 ≤ 11.0
column-width
column-count
≥ 10
(2012)
≥ 1.5
(2005)
≥ 3
(2007)
≥ 1
(2008)
≥ 11.1
(2011)
columns ≥ 10
(2012)
≥ 9
(2011)
≥ 3
(2007)
≥ 1
(2008)
≥ 11.1
(2011)
break-before
break-after
break-inside
≥ 10
(2012)
≥ 65
(2019)
≥ 10
(2016)
≥ 65
(2016)
≥ 15
(2013)

Các ví dụ[sửa mã nguồn]

Đây là một ví dụ:

{{columns-list|colwidth=35em|
* [[George Washington]]
* [[John Adams]]
* [[Thomas Jefferson]]
* [[James Madison]]
* [[James Monroe]]
}}

mà sẽ hiển thị như sau:

Các kiểu CSS cũng có thể được thêm vào với tham số |style=. Cho ví dụ:

{{columns-list|colwidth=15em|style=width: 600px; font-style: italic;|
* [[All About Lily Chou-Chou]]
* [[April Story]]
* [[Hana and Alice|Hana & Alice]]
* [[Hōtai Club]]
* [[The Kon Ichikawa Story]]
* [[Love Letter (1995 film)|Love Letter]]
* [[New York, I Love You]]
* [[Picnic (1996 film)|Picnic]]
* [[Rainbow Song]]
* [[Swallowtail (film)|Swallowtail]]
}}

mà sẽ hiển thị như sau:

Bản mẫu này cũng hoạt động với các danh sách được đánh số là "văn bản" của nó. Cho ví dụ:

{{columns-list|colwidth=35em|
# [[George Washington]]
# [[John Adams]]
# [[Thomas Jefferson]]
# [[James Madison]]
# [[James Monroe]]
}}

The template, in fact, works with everything since all it does is wrap the text provided around a block to be divided into columns by CSS. Do not stop at wikitext lists – more advanced lists generated by the HTML templates will work too!

Thông báo lỗi[sửa mã nguồn]

Use of the no-longer-supported parameter |cols=, or use of the first unnamed parameter (aka |1=) along with |2= or a second unnamed parameter for the template's content, will generate a red error message. To fix this error, use |colwidth= instead of attempting to specify the number of columns.

The presence of an equals sign within the template's content can also cause display problems and red error messages. To fix this problem, add |1= in front of the template's content.

Trang đổi hướng[sửa mã nguồn]

Thể loại theo dõi[sửa mã nguồn]

Xem thêm[sửa mã nguồn]

Gia đình bản mẫu tạo ra cột[sửa mã nguồn]

Gia đình Loại
Xử lý mã
 bảng wiki?dagger
Bản mẫu bắt đầu Phân chia cột Bản mẫu kết thúc
"Col" Bảng {{Col-begin}},
{{Col-begin-fixed}} hoặc
{{Col-begin-small}}
{{Col-break}} hoặc
{{Col-2}} .. {{Col-5}}
{{Col-end}}
"Col-float" CSS float {{Col-float}} {{Col-float-break}} {{Col-float-end}}
"Columns" Bảng Không {{Columns}}
"Columns-list" Các cột CSS {{Columns-list}} (bao bọc)
"Columns-start" CSS float {{Columns-start}} {{Column}} {{Columns-end}}
"Div col" Các cột CSS {{Div col}} {{Div col end}}

dagger Tức là, các cột có thể xử lý đánh dấu wiki {| | || |- |} được sử dụng để tạo bảng? Nếu không, các mẫu tạo ra các phần tử này (chẳng hạn như {{(!}}, {{!}}, {{!!}}, {{!-}}, {{!)}}) và/hoặc thẻ HTML (<table>...</table>, <tr>...</tr>, v.v.) sẽ cần được sử dụng thay thế.