साँचा:तालिका संरेखण
(साँचा:Table alignment से अनुप्रेषित)
Purpose
संपादित करेंTo make it simpler to align the columns in tables with less wikicode.
Usage
संपादित करेंPlace {{Table alignment}}
just before the table and then add some classes to the table.
classname | Purpose |
---|---|
defaultleft |
Align all table cells left by default |
defaultcenter |
Align all table cells center by default |
defaultright |
Align all table cells right by default |
colNleft |
Align the cells in column N left, where N is a number |
colNcenter |
Align the cells in column N center, where N is a number |
colNright |
Align the cells in column N right, where N is a number |
With the wikitable class the header cell content is always centered unless individually adjusted.
The col and default classes never affect the header cells (column, row, or anywhere) if the wikitable class is used. The col class overrides the default class.
If the wikitable class is not used, then col and default affect header cells.
Limitations
संपादित करें- Column numbers up to
col29
are supported. A table can have more columns but they cannot be aligned with this method. - On tables using
rowspan
orcolspan
, using the classes may not work well on those rows because the alignment appears in wrong cells. Normal table code likestyle="text-align: left/center/right;"| cell content
can be added to individual cells, both to get the wanted alignment and override unwanted alignment.
Example
संपादित करें{{Table alignment}}
{| class="wikitable defaultcenter col1left col4right"
!Item1
!Item2
!Item3
!Item4
|-
|AAAAAA
|100-200
|3-4
|53.43
|-
|BBB
|5-6
|7-8
|5563.35
|-
|CC
|9-10
|113-125
|322313.00
|}
Item1 | Item2 | Item3 | Item4 |
---|---|---|---|
AAAAAA | 100-200 | 3-4 | 53.43 |
BBB | 5-6 | 7-8 | 5563.35 |
CC | 9-10 | 113-125 | 322313.00 |
See also
संपादित करें- {{shy}} – Can be used to help narrow columns by adding a soft hyphen to a word to allow it to wrap.
More template styles for tables:
- {{sticky header}} - Makes column headers stick to the top of the page while scrolling through table data.
- {{sort under}} - moves the sorting arrows under the headers.
- {{row hover highlight}} - adds row hover highlighting, and option for white background.
- {{static row numbers}} - adds a column of row numbers to a table.
ऊपर दिए गए निर्देश साँचा:तालिका संरेखण/doc से लिए गए है।(संपादन | इतिहास) संपादक इस साँचे के प्रयोगस्थल व प्रयोग पन्नों में प्रयोग कर सकते है। sandbox (create) and testcases (create) pages. कृपया /doc उपपृष्ठ पर श्रेणियाँ व विकियों के बिच की कड़ियाँ जोड़े। इस साँचे के उपपृष्ठ। |