Bản mẫu:Col-break
| style="text-align: left; vertical-align: top; " |
Bản mẫu cột | |
---|---|
Col-Break | |
{{Col-begin}} | Start |
{{Col-break}} | Break |
{{Col-end}} | End |
Col-float | |
{{Col-float}} | Start |
{{Col-float-break}} | Break |
{{Col-float-end}} | End |
Columns-start | |
{{Columns-start}} | Start |
{{Column}} | Break |
{{Columns-end}} | End |
The {{col-begin}}, {{col-break}} and {{col-end}} templates control columns of text on a page:
- {{col-begin}}: starts a table (followed by {{col-break}} for 1st column)
- {{col-break}}: triggers the start of each column
- {{col-end}}: ends the multi-column table.
The widths of columns can be specified by using various additional codes. See below for examples.
Mục lục
Cách sử dụng[sửa mã nguồn]
- {{col-begin|width=70%}}: start table with width.
- {{col-break|width=66%}}: start column-1 as 66% wide.
- This is text in col-1.
- {{col-break|width=33%}}: start column-2 as 33% wide.
- Text column-2.
- {{col-end}}
The table will have two columns, with column 1 twice (2×) the width of column 2.
A border of 2px (1px width on each side) corresponds to a 5%. Therefore, with a 2px border—for example, as in Wikipedia:Tutorial/Wrap-up and more info—the width needs to be 95% for the table to fit within the screen. Since it's possible that some tables might not have a border, correction on the individual page could be made after substitution. Another way to create a two column table is like this:
{{col-begin|width=95%}} |- | Cột bên trái | Cột bên phải |} |
{{Col-begin}} {{Col-2}} Cột 1 ở đây {{Col-2}} Cột 2 ở đây {{Col-end}} |
{{Col-begin}} {{Col-3}} Cột 1 ở đây {{Col-3}} Cột 2 ở đây {{Col-3}} Cột 3 ở đây {{Col-end}} |
và như vậy, đến {{Col-5}} |
{{Col-begin}} {{Col-break}} Cột 1 ở đây {{Col-break}} Cột 2 ở đây {{Col-break}} Cột 3 ở đây {{Col-break}} Cột 4 ở đây {{Col-break}} Cột 5 ở đây {{Col-break}} Cột 6 ở đây {{Col-end}} |
{{Columns-start|num=3}} Cột 1 ở đây {{Column}} Cột 2 ở đây {{Column}} Cột 3 ở đây {{Columns-end}} |
{{Multicol}} Cột 1 ở đây {{Multicol-break}} Cột 2 ở đây {{Multicol-break}} Cột 3 ở đây {{Multicol-break}} Cột 4 ở đây {{Multicol-end}} |
Ví dụ[sửa mã nguồn]
Xem thêm[sửa mã nguồn]
Column-generating template families[sửa mã nguồn]
![]() | The templates listed here are not interchangeable. For example, using {{col-float}} with {{col-end}} instead of {{col-float-end}} would leave a HTML "div" (division) open, potentially harming any subsequent formatting. |
Gia đình | Kiểu | Handles wiki
table code? ![]() |
Bản mẫu bắt đầu | Phân chia cột | Bản mẫu kết thúc |
---|---|---|---|---|---|
"Col" | Table | Có | {{Col-begin}} hoặc {{Col-begin-small}} |
{{Col-break}} {{Col-2}} .. {{Col-5}} |
{{Col-end}} |
"Columns" | Table | Không | {{Columns}} | – | – |
"Col-float" | CSS float | Có | {{Col-float}} | {{Col-float-break}} | {{Col-float-end}} |
"Columns-start" | CSS float | Có | {{Columns-start}} | {{Column}} | {{Columns-end}} |
"Div col" | CSS columns | Có | {{Div col}} – {{Columns-list}} (wrapper) |
– | {{Div col end}} |
I.e., can the columns handle the wiki markup {| | || |- |} used to create tables? If not, templates that produce these elements (such as {{(!}}, {{!}}, {{!!}}, {{!-}}, {{!)}}) and/or HTML tags (
<table>...</table>
, <tr>...</tr>
, etc.) will need to be used instead.
Liên kết ngoài[sửa mã nguồn]
Dữ liệu bản mẫu[sửa mã nguồn]
This template triggers the start of each column in a multi-column table.
Tham số | Miêu tả | Kiểu | Trạng thái | |
---|---|---|---|---|
Column width | width | Width of the column, defined as a percent (ie 50%) | Chuỗi | tùy chọn |
Tài liệu ở trên được chuyển tải từ Bản mẫu:Col-break/doc. (sửa | sử) Những người sửa đổi có thể thử nghiệm trong các trang chỗ thử (tạo | sao) và trường hợp kiểm thử (tạo) của bản mẫu này. Xin hãy bổ sung các thể loại vào trang con /doc. Các trang con của bản mẫu này. |