• Trang chính
  • Ngẫu nhiên
  • Lân cận
  • Đăng nhập
  • Tùy chọn
Donate Now If Wikipedia is useful to you, please give today.
  • Giới thiệu Wikipedia
  • Lời phủ nhận
Wikipedia

Bản mẫu:Indent

  • Ngôn ngữ
  • Theo dõi
  • Sửa đổi
Tài liệu bản mẫu[xem] [sửa] [lịch sử] [làm mới]
Bản mẫu này sử dụng Lua:
  • Mô đun:Indent

The indenter Bản mẫu:Indent performs a newline and indents by a specified number of spaces. However, the spaces are not all the same size, but rather a mixture of en-size & em-size spaces that have been tested to work on a wide range of browsers. (To skip by n equal-size spaces, instead use {{in5|n}} which puts all as the standard-size " " space, and does not force a newline.)

Mục lục

  • 1 Cách sử dụng
  • 2 Các ví dụ
  • 3 Analysis of uneven spacing
  • 4 Lịch sử
  • 5 Xem thêm

Cách sử dụng

sửa

The indentation spacing generated by Bản mẫu:Indent will match the alignment of a colon-shift (":") by using {{indent|5}}. To match "::", use {{indent|10}}.

Cách sử dụng: {{indent|# of spaces}}

  • Indents up to 30 spaces. (use {{in5|n}} to skip up to 50 spaces)
  • Indent differs from {{khoảng cách}} only in that it automatically begins a wrapped-newline, then spaces over n spaces, whereas {{khoảng cách}} spaces over n in the same (current) line.

Các ví dụ

sửa

The following are detailed examples, also comparing to the equivalent indentation generated if a colon-shift ":" were used instead.

Ví dụ 1 – Indenting by 5:
Cú pháp
Some text.{{indent|5}}Some more text.
Kết quả Some text.
     Some more text.
Ví dụ 2 – Alignment with ":" hoặc "::" indentations:
Cú pháp
: Line of colon-shifted text.
{{indent|5}}Line of indent-5-shifted text.
<br>      Line of br-6-nbsp-shifted text.
<br>     Line of br-5-nbsp-shifted text.
<br>     Line of br-5-nbsp-true-shifted text.
:: Line of 2-colon-shifted text.
{{khoảng cách|10}}Line of space-10-shifted text.
Kết quả : Line of colon-shifted text.


     Line of indent-5-shifted text.
      Line of br-6-nbsp-shifted text.
     Line of br-5-nbsp-shifted text.
     Line of br-5-nbsp-true-shifted text.

Line of 2-colon-shifted text.

          Line of space-10-shifted text.

Note that if the prior line is already colon-shifted text, then using "{{indent|5}}" generates a blank line first, so instead, use "{{khoảng cách|5}}" (or such) after a colon-shifted line.

Analysis of uneven spacing

sửa

As computers optimize code, they occasionally risk displaying unsavory results after condensing monotonous strings of characters (such as spaces). Thus, many templates around Wiki choose to avoid this hurdle by alternating different types of spaces (with the intention of displaying no differently than regular spaces).

Spaces come in two main size varieties: em spaces and en spaces. Em spaces are generally defined as the width of one character, and en spaces exactly half that size. However, there is no requirement that browsers must conform to this standard, and so templates that code in en spaces may not display uniformly across all browsers. Neither {{indent}} nor {{khoảng cách}} use true space-size (that is, em-size spaces), but rather mix en and em spaces, whereas {{in5|n}} avoids en spaces altogether and will actually skip n count of spaces, as if inserting n repetitions of an em space. This is done by alternating em spaces with an em-size non-breaking "&nbsp;"—by definition, it must be the same—in order to skip a wide area.

Lịch sử

sửa

This template originated on the sister project Wikisource—(main page), and was subsequently ported to English Wikipedia at 21:27, ngày 26 tháng 5 năm 2006 (UTC).

Xem thêm

sửa
  • Mô đun:Indent, the Lua module implementing this template.
  • {{spaces}}, which uses non-breaking spaces.
  • {{in5}}, which skips up to fifty equal en-sized spaces.
  • {{block indent}}, to indent an entire block of content, similar to a block quotation (uses <div> and CSS margins)
  • {{colon}}, to produce a colon character (":") without risk of affecting wiki markup.
  • {{outdent}}, to break indentation in a threaded conversation
Tài liệu bên trên được truyền tải từ Bản mẫu:Indent/doc. (sửa | lịch sử)
Biên tập viên 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.
Lấy từ “https://vi.wikipedia.org/w/index.php?title=Bản_mẫu:Indent&oldid=25429578”
Sửa đổi lần cuối lúc 16:04 vào ngày 4 tháng 11 năm 2016

Ngôn ngữ

    • العربية
    • Azərbaycanca
    • تۆرکجه
    • Bahasa Indonesia
    • Bahasa Melayu
    • Basa Bali
    • বাংলা
    • भोजपुरी
    • Čeština
    • Dansk
    • English
    • فارسی
    • Føroyskt
    • Gàidhlig
    • Galego
    • ગુજરાતી
    • 한국어
    • हिन्दी
    • Igbo
    • ქართული
    • Қазақша
    • Ikirundi
    • Latviešu
    • Македонски
    • മലയാളം
    • मराठी
    • မြန်မာဘာသာ
    • नेपाली
    • 日本語
    • ଓଡ଼ିଆ
    • Oʻzbekcha / ўзбекча
    • ਪੰਜਾਬੀ
    • တႆး
    • Português
    • ᱥᱟᱱᱛᱟᱲᱤ
    • සිංහල
    • Simple English
    • Slovenščina
    • Српски / srpski
    • Srpskohrvatski / српскохрватски
    • Sunda
    • Tagalog
    • ไทย
    • Türkçe
    • Türkmençe
    • Українська
    • اردو
    • 粵語
    • 中文
    Wikipedia
    • Wikimedia Foundation
    • Powered by MediaWiki
    • Trang này được sửa đổi lần cuối vào ngày 4 tháng 11 năm 2016, 16:04.
    • Nội dung được phát hành theo CC BY-SA 4.0, ngoại trừ khi có ghi chú khác.
    • Quy định quyền riêng tư
    • Giới thiệu Wikipedia
    • Lời phủ nhận
    • Bộ Quy tắc Ứng xử Chung
    • Lập trình viên
    • Thống kê
    • Tuyên bố về cookie
    • Điều khoản sử dụng
    • Phiên bản máy tính