Bản mẫu:Một vài
Một vài |
Các mẫu trong loạt bài này được thiết kế để sử dụng trong các bảng để tạo ra các ô với các văn bản trong đó, với một nền màu thích hợp. Chúng thường được sử dụng trong các bảng so sánh.
Ví dụ, {{yes}}
làm cho một ô có một nền màu xanh lá cây. Các văn bản trong các ô được lấy từ các tham số đầu tiên; {{yes|Chắc chắn rồi}}
sẽ ra "Chắc chắn rồi" nếu không nó mặc định là "Yes". Hầu hết các mẫu cho phép tác giả để ghi đè lên các văn bản mặc định theo cách này, một số yêu cầu đặt văn bản sau khi cuộc gọi và một số mẫu cũng cần một thanh dọc ở giữa: {{table cell template}} text
hoặc {{table cell template}}|text
. Những thông tin này, các màu sắc và các văn bản mặc định được tìm thấy trong bảng dưới đây.
Nếu bạn muốn sử dụng các thuộc tính khác cho các ô bảng, ví dụ như colspan
hoặc rowspan
, họ cần phải được đặt trước khi cuộc gọi mẫu và phải có không có thanh dọc |
ở giữa chúng:
Có | Không | Không có |
---|---|---|
Có/Không |
... !{{Yes}} ||{{No}} ||rowspan=2 {{n/a}} |- |colspan=2 {{Yes-No}} ...
Templates[sửa mã nguồn]
Class[1] | Default syntax | Preview (default) | Customized syntax | Preview (customized) |
---|---|---|---|---|
table-rh |
{{rh}} | Row header[2] | Row header | {{rh|align=right}} | Row header | Row header |
{{rh2}} | Row header[2] | Row header | {{rh2|align=right}} | Row header | Row header | |
table-yes |
{{yes}} | Có | {{yes|Customized [[Plain text|text]]}} | Customized text |
table-maybe |
{{maybe}} | Có lẽ | {{maybe|Customized [[Plain text|text]]}} | Customized text |
table-no |
{{no}} | Không | {{no|Customized [[Plain text|text]]}} | Customized text |
{{eliminated}} | Bị loại | {{eliminated|Dropped out}} | Dropped out | |
{{active fire|12%}} | Active (12%) | |||
{{lost}} | Lost | {{lost|Missing}} | Missing | |
{{safe}} | Safe | {{safe|Protected}} | Protected | |
table-active |
{{active}} | Đang hoạt động | {{active|Lively}} | Lively |
table-siteactive |
{{site active}} | Hoạt động | {{site active|Up}} | Up |
{{coming soon}} | Sắp có | {{coming soon|Second half of the year}} | Second half of the year | |
table-siteinactive |
{{site inactive}} | Không hoạt động | {{site inactive|Down}} | Down |
table-yes2 |
{{good}} | Tốt | {{good|A}} | A |
{{yes2}} | {{yes2|Text}} | Text | ||
{{ya}} | ![]() |
{{ya|text=Ya}} | ![]() | |
{{ya|Ya}} | ![]() |
{{ya|text|link=WP:ALT}} | ![]() | |
{{won}} | Đoạt giải | {{won|text=white|color=darkblue}} | Đoạt giải | |
{{won|place=1}} | 1 | {{won|place=Gold}} | Gold | |
{{won|place=2}} | 2 | {{won|place=Silver}} | Silver | |
{{won|place=3}} | 3 | {{won|place=Bronze}} | Bronze | |
{{WinDL}} | W | {{WinDL|Win}} | Win | |
{{WinDL|res=D}} | D | {{WinDL|res=Draw}} | Draw | |
{{WinDL|res=L}} | L | {{WinDL|res=Loss}} | Loss | |
table-no2 |
{{no2}} | {{no2|Text}} | Text | |
{{na}} | ![]() |
{{na|text=Na}} | ![]() | |
{{na|Na}} | ![]() |
{{na|text|link=WP:ALT}} | ![]() | |
{{nom}} | Đề cử | {{nom|5}} | 5 | |
{{sho}} | Lọt vào danh sách | {{sho|Proposed}} | Proposed | |
{{longlisted}} | Longlisted | {{longlisted|Rejected}} | Rejected | |
{{TBA}} | CTB | {{TBA|To be announced}} | To be announced | |
table-success |
{{success}} | Thành công | {{success|Mission complete}} | Mission complete |
{{operational}} | Operational | {{operational|Returning data}} | Returning data | |
table-failure |
{{failure}} | Thất bại | {{failure|Wrong orbit}} | Wrong orbit |
table-partial |
{{partial}} | Một phần | {{partial|Almost done}} | Almost done |
{{Regional}} | Regional | {{Regional|Uyghur}} | Uyghur | |
{{MaybeCheck}} | ![]() |
{{MaybeCheck|text=Possibly}} | Possibly | |
{{MaybeCheck|Possibly}} | ![]() |
{{MaybeCheck|text|link=WP:ALT}} | ![]() | |
{{partial success}} | Bản mẫu:Partial success | {{partial success|Reached orbit and returned pictures}} | Bản mẫu:Partial success | |
{{partial failure}} | Bản mẫu:Partial failure | {{partial failure|[[Cubesat]] not deployed}} | Bản mẫu:Partial failure | |
{{okay}} | Trung lập | {{okay|C}} | C | |
{{Yes-No}} | Có/Không | {{Yes-No|Yes with an if; no with a but}} | Yes with an if; no with a but | |
{{some}} | Một vài | {{some|Many}} | Many | |
{{nonpartisan}} | Bản mẫu:Nonpartisan | {{nonpartisan|Impartial}} | Bản mẫu:Nonpartisan | |
{{pending}} | Chưa quyết định | {{pending|Awaiting}} | Awaiting | |
{{unofficial}} | Không chính thức | {{unofficial|''De facto''}} | De facto | |
{{unofficial2}} | Bản mẫu:Unofficial2 | {{unofficial2|''De facto''}} | Bản mẫu:Unofficial2 | |
{{usually}} | Thường xuyên | {{usually|Commonly}} | Commonly | |
{{rarely}} | Bất thường | {{rarely|Seldom}} | Seldom | |
{{sometimes}} | Đôi khi | {{sometimes|Occasionally}} | Occasionally | |
table-any |
{{any}} | Bất kỳ | {{any|Anyone}} | Anyone |
table-na |
{{n/a}} | Không có | {{n/a|Unavailable}} | Unavailable |
{{varies}} | Bản mẫu:Varies | {{varies|Differs}} | Bản mẫu:Varies | |
{{sdash}} | — | {{sdash|[[File:Dash.svg|13px|link=|dash icon]]}} | ![]() | |
{{BLACK}} | N/A | {{BLACK|Banned}} | Banned | |
{{non-album single}} | Đĩa đơn không nằm trong album | {{non-album single|Customized [[Plain text|text]]}} | Customized text | |
{{unreleased}} | Bản mẫu:Unreleased | {{unreleased|Customized [[Plain text|text]]}} | Bản mẫu:Unreleased | |
table-unknown |
{{unknown}} | Không biết | {{unknown|?}} | ? |
{{dunno}} | ? | {{dunno|Not sure}} | Not sure | |
table-automatic |
{{perhaps}} | Bản mẫu:Perhaps | {{perhaps|Customized [[Plain text|text]]}} | Bản mẫu:Perhaps |
table-depends |
{{depends}} | Tùy thuộc | {{depends|Customized [[Plain text|text]]}} | Customized text |
table-included |
{{included}} | Đi kèm | {{included|Incorporated}} | Incorporated |
table-dropped |
{{dropped}} | Đã bỏ | {{dropped|Discontinued}} | Discontinued |
{{terminated}} | Đã ngưng | {{terminated|Fired}} | Fired | |
table-beta |
{{beta}} | Beta | {{beta|Preview}} | Preview |
table-experimental |
{{table-experimental}} | Thử nghiệm | {{table-experimental|Customized [[Plain text|text]]}} | Customized text |
table-free |
{{free}} | Tự do | {{free|Customized [[Plain text|text]]}} | Customized text |
table-proprietary |
{{proprietary}} | Độc quyền | {{proprietary|Customized [[Plain text|text]]}} | Customized text |
table-nonfree |
{{nonfree}} | Không tự do | {{nonfree|Customized [[Plain text|text]]}} | Customized text |
table-needs |
{{needs}} | Nhu cầu | {{needs|Customized [[Plain text|text]]}} | Customized text |
table-nightly |
{{nightly}} | Đêm xây dựng | {{nightly|Customized [[Plain text|text]]}} | Customized text |
table-release-candidate |
{{release-candidate}} | Phát hành ứng cử viên | {{release-candidate|Customized [[Plain text|text]]}} | Customized text |
table-draw |
{{draw}} | {{draw|Text}} | Text | |
table-planned |
{{planned}} | Đã lên kế hoạch | {{planned|July 2018}} | July 2018 |
table-scheduled |
{{scheduled}} | Đã có lịch trình | {{scheduled|3 March 2017}} | 3 March 2017 |
incorrect |
{{incorrect}} | Chưa chính xác | {{incorrect|Customized [[Plain text|text]]}} | Customized text |
noresult |
{{no result}} | Không có kết quả | {{no result|N.R.}} | N.R. |
table-debate
|
{{D-P}} | Bản mẫu:D-P | {{D-P|Present}} | Bản mẫu:D-P |
{{D-A}} | Bản mẫu:D-A | {{D-A|Absent}} | Bản mẫu:D-A | |
{{D-I}} | Bản mẫu:D-I | {{D-I|Invited}} | Bản mẫu:D-I | |
{{D-O}} | Bản mẫu:D-O | {{D-O|Invited to other debate}} | Bản mẫu:D-O | |
{{D-N}} | Bản mẫu:D-N | {{D-N|Not invited}} | Bản mẫu:D-N | |
{{D-W}} | Bản mẫu:D-W | {{D-W|Withdrawn}} | Bản mẫu:D-W | |
{{D-Out}} | Bản mẫu:D-Out | {{D-Out|Out of race}} | Bản mẫu:D-Out | |
no class | {{CMain}} | Chính | {{CMain|Customized [[Plain text|text]]}} | Customized text |
{{CAlso starring}} | Bản mẫu:CAlso starring | {{CAlso starring|Customized [[Plain text|text]]}} | Bản mẫu:CAlso starring | |
{{CRecurring}} | Phụ | {{CRecurring|Customized [[Plain text|text]]}} | Customized text | |
{{CGuest}} | Khách mời | {{CGuest|Customized [[Plain text|text]]}} | Customized text | |
{{CNone}} | {{CNone|Customized [[Plain text|text]]}} | Customized text | ||
{{CEmpty}} | Bản mẫu:CEmpty | |||
{{nocontest}} | Bản mẫu:Nocontest | {{nocontest|Customized [[Plain text|text]]}} | Bản mẫu:NocontestCustomized text | |
{{not yet}} | Bản mẫu:Not yet | {{not yet|Customized [[Plain text|text]]}} | Bản mẫu:Not yet | |
{{optional}} | Bản mẫu:Optional | {{optional|Customized [[Plain text|text]]}} | Bản mẫu:Optional | |
{{Runner-up}} | Bản mẫu:Runner-up | {{Runner-up|Customized [[Plain text|text]]}} | Bản mẫu:Runner-up | |
{{CRemoved}} | Bản mẫu:CRemoved | {{CRemoved|Customized [[Plain text|text]]}} | Bản mẫu:CRemoved | |
{{Quit}} | Bản mẫu:Quit | {{Quit|Customized [[Plain text|text]]}} | Bản mẫu:Quit | |
{{CFinalist}} | Bản mẫu:CFinalist | {{CFinalist|text=white|color=darkblue}} | Bản mẫu:CFinalist | |
{{CFinalist|place=3rd Place}} | Bản mẫu:CFinalist | {{CFinalist|place=Third Place}} | Bản mẫu:CFinalist | |
{{Enroute}} | Bản mẫu:Enroute | {{Enroute|Customized text}} | Bản mẫu:Enroute |
Mã nguồn[sửa mã nguồn]
Mã chung cho hầu hết nếu không muốn nói là tất cả các bản mẫu của loạt bản mẫu này:
style="background: #abcdef; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}" class="automatic table-automatic"| {{{1|text}}}
Mã cụ thể cho mẫu này:
style="background: #FFD; color: black; vertical-align: middle; text-align: center; " class="partial table-partial"|Một vài
Để thực hiện một mẫu ô trong bảng mới, bạn có thể sử dụng:
{{subst:Table cell templates|text= default text |bg= background color |class= a class name without prefix |align= standard horizontal alignment}}
Bạn nên bỏ qua align
tham số và thường là class
tham số là không cần thiết, quá.
Thêm mẫu mới vào bảng trong Tài liệu phổ biến sau đó. Vui lòng xem xét việc tái sử dụng một trong những mẫu khác và hãy chọn màu hợp lý.
Nếu bạn tìm thấy một mẫu ô trong bảng mà không có một tham số và bạn muốn để có thể thay đổi các văn bản trong tế bào, không lặp lại trong các mẫu! Thay vào đó, chỉnh sửa các mẫu và thay đổi các văn bản để thay người thông số mặc định. Ví dụ, nếu văn bản của một mẫu được Dropped
, thay đổi đó để {{{1|Dropped}}}
.
style="background: #abcdef; color: black; vertical-align: middle; text-align: center; " class="automatic table-automatic"| text
Cách sử dụng[sửa mã nguồn]
Một vài mẫu cho phong cách cá nhân với tế bào bảng nội dung tiêu chuẩn và màu sắc.
Tham số | Miêu tả | Kiểu | Trạng thái | |
---|---|---|---|---|
Văn bản | 1 | Dòng chữ thay thế cho văn bản mặc định
| Dòng | tùy chọn |
horizontal align | align | dóng văn bản bên trong ô, có thể nhận các giá trị 'left', 'right' hoặc 'center' (trái, phải, giữa)
| Dòng | tùy chọn |
style | style | một danh sách cách nhau bởi dấu chấm phẩy các quy tắc CSS bổ sung được áp dụng cho ô trong bảng
| Dòng | tùy chọn |
Màu nền của ô | color | một giá trị màu CSS hợp lí để ghi đè lên màu nền mặc định, chỉ một số bản mẫu có tham số này
| Dòng | tùy chọn |
Ghi chú[sửa mã nguồn]
- ^ The HTML class of table cell templates may be referenced in a user stylesheet to change appearance.
- ^ a ă Does not take a parameter; the content should be placed after the template call, separated by a pipe (|) character.
Tài liệu bên trên được chuyển tải từ Bản mẫu:Tiêu bản của bảng/doc. (sửa | lịch 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. Các trang con của bản mẫu này. |