"प्रयोग:Janmejay6" के अवतरणों में अंतर

भारत डिस्कवरी प्रस्तुति
यहाँ जाएँ:भ्रमण, खोजें
छो (श्रेणी:सहायता (को हटा दिया गया हैं।))
(पन्ने को खाली किया)
 
पंक्ति 1: पंक्ति 1:
भारतकोश में  तालिका XHTML तालिका का उपयोग सीधे-सीधे हो सकता है किंतु विकी समायोजना पर आधारित "bharattable" का प्रयोग करना सुविधाजनक है। यह दूसरे योगदान कर्ताओं के लिए भी सुविधाजनक है।
 
  
तालिकाओं का प्रयोग लेख की आवश्यक होने और पन्ने को सुदृश्य बनाने के लिए ही किया जाना चाहिए। अनावश्यक उपयोग पन्ने के संपादन में बाधक हो सकता है।
 
 
== "bharattable" तालिका लगाने के तरीक़े ==
 
{|cellpadding="5" cellspacing="0" border="1" width="60%"
 
|
 
<nowiki>{|</nowiki>
 
| '''तालिका शुरू''' (table start)
 
 
|-
 
|
 
<nowiki>|+</nowiki>
 
| तालिका शीर्षक (वैकल्पिक) केवल "तालिका शुरू" और "तालिका पंक्ति" के बीच में<br />
 
table '''caption,''' ''optional;'' only between '''table start''' and first '''table row'''
 
|-
 
|
 
<nowiki>|-</nowiki>
 
| "तालिका पंक्ति"<br /> " प्रथम पंक्ति के लिए (वैकल्पिक) -- विकी इंजन इसे प्रथम पंक्ति मानता है।
 
'''table row,''' ''optional on first row'' -- wiki engine assumes the first row
 
|-
 
|
 
<nowiki>!</nowiki>
 
| '''तालिका शीर्षक''' 
 
'''table header''' cell, ''optional.'' Consecutive '''table header''' cells may be added on same line separated by double marks (<code>!!</code>) or start on new lines, each with its own single mark (<code>!</code>).
 
|-
 
|
 
<nowiki>|</nowiki>
 
| '''तालिका पाठ''' के लिए नया सॅल। सॅल एक ही पंक्ति में भी लगाये जा सकते हैं। 
 
'''table data''' cell, ''required!'' Consecutive '''table data''' cells may be added on same line separated by double marks (<code><nowiki>||</nowiki></code>) or start on new lines, each with its own single mark (<code><nowiki>|</nowiki></code>).
 
|-
 
|
 
<nowiki>|}</nowiki>
 
| '''तालिका समाप्त'''
 
'''table end'''
 
|}
 
*The above marks must '''start on a new line''' except the double <code>||</code> and <code>!!</code> for optionally adding consecutive cells to a line. However, blank spaces at the beginning of a line are ignored.
 
*'''XHTML attributes.''' Each mark, except table end, optionally accepts one or more XHTML attributes. Attributes must be on the same line as the mark. Separate attributes from each other with a single space.
 
**Cells and caption (<code>|</code> or <code>||</code>, <code>!</code> or <code>!!</code>, and <code>|+</code>) hold content. So separate any attributes from content with a single pipe (<code>|</code>). Cell content may follow on same line or on following lines.
 
**Table and row marks (<code>{|</code> and <code>|-</code>) do not directly hold content. Do ''not'' add pipe (<code>|</code>) after their optional attributes. If you erroneously add a pipe after attributes for the table mark or row mark the parser will delete it ''and'' your final attribute if it was touching the erroneous pipe!
 
*'''Content''' may (a) follow its cell mark on the same line after any optional XHTML attributes or (b) on lines below the cell mark. Content that uses wiki markup that itself needs to start on a new line, such as lists, headings, or nested tables, must be on its own new line.
 
*'''Escaping''' to insert a pipe (<code>|</code>) character into a table use the &lt;nowiki&gt; markup
 
 
==साधारण तालिका==
 
निम्नांकित तालिका भारतकोश पर इस्तेमाल की जानी वाली साधारण तालिका के प्रारूप को दर्शाती है।
 
 
{| cellspacing="0" border="1"
 
!style="width:50%"|आप टाइप करें
 
!style="width:50%"|नतीजा होगा
 
|-
 
|
 
<pre>
 
{|
 
|संतरा
 
|सेब
 
|-
 
|दूध
 
|दही
 
|-
 
|मक्खन
 
|पनीर
 
|}
 
</pre>
 
|
 
{|
 
|संतरा
 
|सेब
 
|-
 
|दूध
 
|दही
 
|-
 
|मक्खन
 
|पनीर
 
|}
 
|}
 
The cells in the same row can be listed on one line separated by <code>||</code> (two pipe symbols). If the text in the cell contains a line break, use <code><nowiki><br /></nowiki></code> instead.
 
 
{| cellspacing="0" border="1"
 
!style="width:50%"|आप टाइप करें
 
!style="width:50%"|नतीजा होगा
 
|-
 
|
 
<pre>
 
{|
 
|संतरा||सेब||अतिरिक्त
 
|-
 
|दूध||दही||अतिरिक्त
 
|-
 
|मक्खन||रस<br />गुल्ला||<br />अतिरिक्त
 
|}
 
</pre>
 
|
 
{|
 
|संतरा||सेब||अतिरिक्त
 
|-
 
|दूध||दही||अतिरिक्त
 
|-
 
|मक्खन||रस<br />गुल्ला||<br />अतिरिक्त
 
|}
 
|}
 
 
Extra spaces within cells in the wiki markup, as in the wiki markup below, do not affect the actual table rendering.
 
 
{| cellspacing="0" border="1"
 
!style="width:50%"|आप टाइप करें
 
!style="width:50%"|नतीजा होगा
 
|-
 
|
 
<pre>
 
{|
 
|  संतरा  ||  सेब  ||  अतिरिक्त
 
|-
 
|  दूध    ||  दही    ||  अतिरिक्त
 
|-
 
|  मक्खन  || पनीर ||  अतिरिक्त
 
|}
 
</pre>
 
|
 
{|
 
|  संतरा  ||  सेब  ||  अतिरिक्त
 
|-
 
|  दूध    ||  दही    ||  अतिरिक्त
 
|-
 
|  मक्खन  || पनीर ||  अतिरिक्त
 
|}
 
|}
 
 
You can have longer text or more complex wiki syntax inside table cells, too:
 
 
{| cellspacing="0" border="1"
 
!style="width:50%"|आप टाइप करें
 
!style="width:50%"|नतीजा होगा
 
|-
 
|
 
<pre>
 
{|
 
|भारत एशिया महाद्वीप के दक्षिणी भाग में
 
स्थित तीन प्रायद्वीपों में मध्यवर्ती और सबसे बड़ा प्रायद्वीप है।
 
यह त्रिभुजाकार है। हिमालय पर्वत श्रृंखला को इस त्रिभुज का आधार
 
और कन्याकुमारी को उसका शीर्षबिन्दु कहा जा सकता है।
 
इसके उत्तर में हिमालय तथा दक्षिण में हिन्द महासागर स्थित है।
 
यह स्वतंत्र भौगोलिक इकाई है।
 
 
प्राकृतिक दृष्टि से इसे तीन क्षेत्रों में विभक्त किया जा सकता है
 
हिमालय क्षेत्र, उत्तर का मैदान जिससे होकर सिंधु, गंगा और
 
ब्रह्मपुत्र नदियाँ बहती हैं, दक्षिण का पठार, जिसे विंध्य
 
पर्वतमाला उत्तर के मैदान से अलग करती है।
 
भारत की विशाल जनसंख्या
 
|
 
*भारत एशिया महाद्वीप के दक्षिणी भाग में
 
*यह स्वतंत्र भौगोलिक इकाई है।
 
*यह त्रिभुजाकार है।
 
|}
 
</pre>
 
|
 
{|
 
|भारत एशिया महाद्वीप के दक्षिणी भाग में
 
स्थित तीन प्रायद्वीपों में मध्यवर्ती और सबसे बड़ा प्रायद्वीप है।
 
यह त्रिभुजाकार है। हिमालय पर्वत श्रृंखला को इस त्रिभुज का आधार
 
और कन्याकुमारी को उसका शीर्षबिन्दु कहा जा सकता है।
 
इसके उत्तर में हिमालय तथा दक्षिण में हिन्द महासागर स्थित है।
 
यह स्वतंत्र भौगोलिक इकाई है।
 
 
प्राकृतिक दृष्टि से इसे तीन क्षेत्रों में विभक्त किया जा सकता है
 
हिमालय क्षेत्र, उत्तर का मैदान जिससे होकर सिंधु, गंगा और
 
ब्रह्मपुत्र नदियाँ बहती हैं, दक्षिण का पठार, जिसे विंध्य
 
पर्वतमाला उत्तर के मैदान से अलग करती है।
 
भारत की विशाल जनसंख्या
 
|
 
*भारत एशिया महाद्वीप के दक्षिणी भाग में
 
*यह स्वतंत्र भौगोलिक इकाई है।
 
*यह त्रिभुजाकार है।
 
|}
 
|}
 
 
=== Table headers ===
 
Table headers can be created by using "<code>!</code>" (exclamation mark) instead of "<code>|</code>" (pipe symbol). Headers usually show up bold and centered by default.
 
 
{| cellspacing="0" border="1"
 
!style="width:50%"|आप टाइप करें 
 
!style="width:50%"|नतीजा होगा
 
|-
 
|
 
<pre>
 
{|
 
! वस्तु
 
! मूल्य
 
! लागत
 
|-
 
|संतरे
 
|10
 
|7.00
 
|-
 
|बिस्कुट
 
|4
 
|3.00
 
|-
 
|मक्खन
 
|1
 
|5.00
 
|-
 
!कुल योग
 
|
 
|15.00
 
|}
 
</pre>
 
|
 
{|
 
! वस्तु
 
! मूल्य
 
! लागत
 
|-
 
|संतरे
 
|10
 
|7.00
 
|-
 
|बिस्कुट
 
|4
 
|3.00
 
|-
 
|मक्खन
 
|1
 
|5.00
 
|-
 
!कुल योग
 
|
 
|15.00
 
|}
 
|}
 
 
===शीर्षक===
 
A '''table caption''' can be added to the top of any table as follows.
 
 
{| cellspacing="0" border="1"
 
!style="width:50%"|आप टाइप करें
 
!style="width:50%"|नतीजा होगा
 
|-
 
|
 
<pre>
 
{|
 
|+भोजन पूरक
 
|-
 
|संतरा
 
|सेब
 
|-
 
|दूध
 
|दही
 
|-
 
|मक्खन
 
|पनीर
 
|}
 
</pre>
 
|
 
{|
 
|+भोजन पूरक
 
|-
 
|संतरा
 
|सेब
 
|-
 
|दूध
 
|दही
 
|-
 
|मक्खन
 
|पनीर
 
|}
 
|}
 
 
== XHTML attributes ==
 
You can add XHTML attributes to tables. For the authoritative source on these, see [http://www.w3.org/TR/REC-html40/struct/tables.html the W3C's HTML 4.01 Specification page on tables].
 
 
=== Attributes on tables ===
 
Placing attributes after the table start tag (<code>{|</code>) applies attributes to the entire table.
 
 
{| cellspacing="0" border="1"
 
!style="width:50%"|टाइप करें
 
!style="width:50%"|नतीजा पायें
 
|-
 
|
 
<pre>
 
{| border="1"
 
|संतरा
 
|सेब
 
|12,333.00
 
|-
 
|दूध
 
|दही
 
|500.00
 
|-
 
|मक्खन
 
|पनीर
 
|1.00
 
|}
 
</pre>
 
|
 
{| border="1"
 
|संतरा
 
|सेब
 
|12,333.00
 
|-
 
|दूध
 
|दही
 
|500.00
 
|-
 
|मक्खन
 
|पनीर
 
|1.00
 
|}
 
|}
 
 
=== Attributes on cells ===
 
You can put attributes on individual '''cells'''. For example, numbers may look better aligned right.
 
 
{| cellspacing="0" border="1"
 
!style="width:50%"|टाइप करें
 
!style="width:50%"|नतीजा पायें
 
|-
 
|
 
<pre>
 
{| border="1"
 
|संतरा
 
|सेब
 
|align="right" | 12,333.00
 
|-
 
|दूध
 
|दही
 
|align="right" | 500.00
 
|-
 
|मक्खन
 
|पनीर
 
|align="right" | 1.00
 
|}
 
</pre>
 
|
 
{| border="1"
 
|संतरा
 
|सेब
 
|align="right" | 12,333.00
 
|-
 
|दूध
 
|दही
 
|align="right" | 500.00
 
|-
 
|मक्खन
 
|पनीर
 
|align="right" | 1.00
 
|}
 
|}
 
 
You can also use '''cell''' attributes when you are listing multiple '''cells''' on a single line. Note that the '''cells''' are separated by <code>||</code>, and within each '''cell''' the attribute(s) and value are separated by <code>|</code>.
 
 
{| cellspacing="0" border="1"
 
!style="width:50%"|टाइप करें
 
!style="width:50%"|नतीजा पायें
 
|-
 
|
 
<pre>
 
{| border="1"
 
| संतरा  || सेब    || align="right" | 12,333.00
 
|-
 
| दूध  || दही      || align="right" | 500.00
 
|-
 
| मक्खन || पनीर|| align="right" | 1.00
 
|}
 
</pre>
 
|
 
{| border="1"
 
| संतरा  || सेब    || align="right" | 12,333.00
 
|-
 
| दूध  || दही      || align="right" | 500.00
 
|-
 
| मक्खन || पनीर|| align="right" | 1.00
 
|}
 
|}
 
 
===Attributes on rows===
 
You can put attributes on individual '''rows''', too.
 
 
{| cellspacing="0" border="1"
 
!style="width:50%"|टाइप करें
 
!style="width:50%"|नतीजा पायें
 
|-
 
|
 
<pre>
 
{| border="1"
 
|संतरा
 
|सेब
 
|align="right"|12,333.00
 
|-
 
|दूध
 
|दही
 
|align="right"|500.00
 
|- style="font-style:italic; color:green;"
 
|मक्खन
 
|पनीर
 
|align="right"|1.00
 
|}
 
</pre>
 
|
 
{| border="1"
 
|संतरा
 
|सेब
 
|align="right"|12,333.00
 
|-
 
|दूध
 
|दही
 
|align="right"|500.00
 
|- style="font-style:italic; color:green;"
 
|मक्खन
 
|पनीर
 
|align="right"|1.00
 
|}
 
|}
 
 
====Simple one-pixel table border====
 
The default table formatting uses the "border-collapse: separate" model, which adds table cell spacing (which also separates the table outer border from its content cells). Even with a zero cellspacing, the borders of consecutive cells (and of the overall table container) will add up, so to get a one-pixel separation between cells, you need to selectively remove one or more of the four borders of cells.
 
 
Such tables may be formatted more simply, using the "border-collapse: collapse" CSS property; in this table formatting model, the cellspacing attribute (or the CSS "border-spacing:" property) and the table's "padding:" CSS property is ignored and only the larger border of adjacent inner cells (or the table border for outer cells) will be used.
 
 
An example of the above for one-pixel table border, using each model (without need for external extensions):
 
 
{|border="1" cellspacing="0" cellpadding="2"
 
|-
 
!|टाइप करें
 
!width="150"|नतीजा पायें
 
|-
 
|
 
<pre style="font-size: 80%">
 
{|style="border-collapse: separate; border-spacing: 0; border-width: 1px; border-style: solid; border-color: #000; padding: 0"
 
|-
 
!style="border-style: solid; border-width: 0 1px 1px 0"| संतरा
 
!style="border-style: solid; border-width: 0 0 1px 0"| सेब
 
|-
 
|style="border-style: solid; border-width: 0 1px 0 0"| दूध
 
|style="border-style: solid; border-width: 0"| दही
 
|}
 
</pre>
 
|
 
{|style="border-collapse: separate; border-spacing: 0; border-width: 1px; border-style: solid; border-color: #000; padding: 0"
 
|-
 
!style="border-style: solid; border-width: 0 1px 1px 0"| संतरा
 
!style="border-style: solid; border-width: 0 0 1px 0"| सेब
 
|-
 
|style="border-style: solid; border-width: 0 1px 0 0"| दूध
 
|style="border-style: solid; border-width: 0"| दही
 
|}
 
|-
 
|
 
<pre style="font-size: 80%">
 
{|style="border-collapse: collapse; border-width: 1px; border-style: solid; border-color: #000"
 
|-
 
!style="border-style: solid; border-width: 1px"| संतरा
 
!style="border-style: solid; border-width: 1px"| सेब
 
|-
 
|style="border-style: solid; border-width: 1px"| दूध
 
|style="border-style: solid; border-width: 1px"| दही
 
|}
 
</pre>
 
|
 
{|style="border-collapse: collapse; border-width: 1px; border-style: solid; border-color: #000"
 
|-
 
!style="border-style: solid; border-width: 1px"| संतरा
 
!style="border-style: solid; border-width: 1px"| सेब
 
|-
 
|style="border-style: solid; border-width: 1px"| दूध
 
|style="border-style: solid; border-width: 1px"| दही
 
|}
 
|}
 
 
Notes :
 
* When using the "border-width:" CSS shortcut property, the order of the four space-separated specified values is: top, right, bottom, left. When there are fewer than 4 values, the value for left takes its default from the value for right, the value for bottom takes its default from the value for top, and the value for right takes its default from the value for top.
 
* The HTML attributes (such as "width=", "border=", "cellspacing=", "cellpadding=") do not need any length unit (the pixel unit is assumed). The CSS style properties (which override the HTML attributes) require an explicit length unit (if the value is not 0) such as "px" for the pixel.
 
 
===HTML colspan and rowspan===
 
 
You can use HTML '''colspan''' and '''rowspan''' attributes on cells for advanced layout.
 
 
{| cellspacing="0" border="1"
 
!style="width:50%"|टाइप करें
 
!style="width:50%"|नतीजा पायें
 
|-
 
|
 
<pre>
 
{| border="1"
 
!colspan="6"|ख़रीददारी सूची
 
|-
 
|rowspan="2"|रोटी और मक्खन
 
|सेब
 
|पाव
 
|चीनी
 
|colspan="2"|चॉकलेट
 
|-
 
|पनीर
 
|colspan="2"|पनीर
 
|मक्खन
 
|दाल
 
|}
 
</pre>
 
|
 
{| border="1"
 
!colspan="6"|ख़रीददारी सूची
 
|-
 
|rowspan="2"|रोटी और मक्खन
 
|सेब
 
|पाव
 
|चीनी
 
|colspan="2"|चॉकलेट
 
|-
 
|पनीर
 
|colspan="2"|पनीर
 
|मक्खन
 
|दाल
 
|}
 
|}
 
 
===With HTML attributes and CSS styles===
 
[[Manual:CSS|CSS]] style attributes can be added with or without other HTML attributes.
 
 
{| cellspacing="0" border="1"
 
!style="width:50%"|टाइप करें
 
!style="width:50%"|नतीजा पायें
 
|-
 
|
 
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word; word-break:break-all;">
 
{| style="color:green; background-color:#ffffcc;" cellpadding="10" cellspacing="0" border="1"
 
|संतरा
 
|सेब
 
|-
 
|दूध
 
|दही
 
|-
 
|मक्खन
 
|पनीर
 
|}
 
</pre>
 
|
 
{| style="color:green; background-color:#ffffcc;" cellpadding="10" cellspacing="0" border="1"
 
|संतरा
 
|सेब
 
|-
 
|दूध
 
|दही
 
|-
 
|मक्खन
 
|पनीर
 
|}
 
|}
 
 
'''Attributes''' can be added to the caption and headers as follows.
 
 
{| cellspacing="0" border="1"
 
!style="width:50%"|टाइप करें
 
!style="width:50%"|नतीजा पायें
 
|-
 
|
 
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word; word-break:break-all;">
 
{| border="1" cellpadding="20" cellspacing="0"
 
|+ align="bottom" style="color:#e76700;" |''खाद्य पूरक''
 
|-
 
|संतरा
 
|सेब
 
|-
 
|दूध
 
|दही
 
|-
 
|मक्खन
 
|पनीर
 
|Ice cream
 
|}
 
</pre>
 
|
 
{| border="1" cellpadding="20" cellspacing="0"
 
|+ align="bottom" style="color:#e76700;" |''खाद्य पूरक''
 
|-
 
|संतरा
 
|सेब
 
|-
 
|दूध
 
|दही
 
|-
 
|मक्खन
 
|पनीर
 
|}
 
|}
 
 
===Accessibility of table header cells===
 
Table header cells do not explicitly specify which table data cells they apply to (those on their right on the same row, or those below them on the same column). When the table is rendered in a visual 2D environment, this is usually easy to infer.
 
 
However when tables are rendered on non-visual medias, you can help the browser to determine which table header cell applies to the description of any selected cell (in order to repeat its content in some accessibility helper) using a scope="row" or scope="col" attribute on table header cells. In most cases with simple tables, you'll use scope="col" on all header cells of the first row, and scope="row" on the first cell of the following rows:
 
 
{| cellspacing="0" border="1"
 
!style="width:50%"|टाइप करें
 
!style="width:50%"|नतीजा पायें
 
|-
 
|
 
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word; word-break:break-all;">
 
{| border="1" cellspacing="0" cellpadding="2"
 
|-
 
!scope="col"| वस्तु
 
!scope="col"| मात्रा
 
!scope="col"| मूल्य
 
|-
 
!scope="row"| रोटी
 
| 0.3 किग्रा
 
| $0.65
 
|-
 
!scope="row"| मक्खन
 
| 0.125 किग्रा
 
| $1.25
 
|-
 
!scope="row" colspan="2"| कुल योग्य
 
| $1.90
 
|}
 
</pre>
 
|
 
{| border="1" cellspacing="0" cellpadding="2"
 
|-
 
!scope="col"| वस्तु
 
!scope="col"| मात्रा
 
!scope="col"| मूल्य
 
|-
 
!scope="row"| रोटी
 
| 0.3 किग्रा
 
| $0.65
 
|-
 
!scope="row"| मक्खन
 
| 0.125 किग्रा
 
| $1.25
 
|-
 
!scope="row" colspan="2"| कुल योग्य
 
| $1.90
 
|}
 
|}
 
 
==Caveats==
 
 
===Negative numbers===
 
If you start a cell on a new line with a negative number with a minus sign (or a parameter that evaluates to a negative number), your table can get broken, because the characters <code>|-</code> will be parsed as the wiki markup for table row, not table cell. To avoid this, insert a space before the value (<code>| -6</code>) or use in-line cell markup (<code>|| -6</code>).
 
 
===CSS vs Attributes===
 
Table borders specified through CSS rather than the border attribute will render incorrectly in a small subset of text browsers.
 
 
===Common attributes for columns, column groups and row groups===
 
The MediaWiki syntax for tables currently offers no support for specifying common attributes for columns (with the HTML element <code>&lt;col /&gt;</code>), column groups (HTML element <code>&lt;colgroup&gt;...&lt;/colgroup&gt;</code>) and row groups (HTML elements <code>&lt;thead&gt;...&lt;/thead&gt;</code>, <code>&lt;tbody&gt;...&lt;/tbody&gt;<code> and <code>&lt;tfoot&gt;...&lt;/tfoot&gt;</code>). Those standard HTML elements are not accepted even in their HTML or XHTML syntax.
 
 
All the rows and cells (header or data) of the table are rendered within a single implicit row group (HTML element <code>&lt;tbody&gt;...&lt;/tbody&gt;<code>) without any attributes or styles.
 

13:04, 25 जून 2011 के समय का अवतरण