2015-11-03 5 views
5

मेरे पास आरएसटी में एक टेबल है, और मैं स्पिंक्स के साथ एचटीएमएल को संकलित करते समय इसे एक वर्ग जोड़ना चाहता हूं। the docs के अनुसार, तालिका को तालिका में कक्षा जोड़ने से पहले .. class:: निर्देश जोड़ना, लेकिन इसके बजाय यह एक परिभाषा सूची जोड़ता है।स्फिंक्स में एक टेबल में कक्षा जोड़ें?

तालिका कोड है:

.. class:: special 

== == == 
a b c 
1 2 3 
== == == 

जिसमें परिणाम:

<dl class="class"> 
<dt id="special"> 
<em class="property">class </em><code class="descname">special</code><a class="headerlink" href="#special" title="Permalink to this definition">¶</a></dt> 
<dd></dd></dl> 

<table border="1" class="docutils"> 
<colgroup> 
<col width="33%" /> 
<col width="33%" /> 
<col width="33%" /> 
</colgroup> 
<tbody valign="top"> 
<tr class="row-odd"><td>a</td> 
<td>b</td> 
<td>c</td> 
</tr> 
<tr class="row-even"><td>1</td> 
<td>2</td> 
<td>3</td> 
</tr> 
</tbody> 
</table> 

क्या मैं गलत कर रहा हूँ? मैं स्फिंक्स 1.3.1

उत्तर

8

स्पिंक्स डिफ़ॉल्ट डोमेन पायथन है और इसमें class निर्देश है जो मूल डॉकुटिल्स को उसी नाम से निर्देशित करता है।

यह काम करने के लिए, बजाय rst-class का उपयोग करें:

.. rst-class:: special 

== == == 
a b c 
1 2 3 
== == == 

http://sphinx-doc.org/rest.html#id3 देखें।

+0

बहुत बढ़िया, धन्यवाद! – naught101

1

वैकल्पिक रूप से आप के बजाय एक .. table:: निर्देश के साथ अपनी मेज लपेट और उसके :class: विकल्प इस्तेमाल कर सकते हैं:

.. table:: 
    :class: special 

    == == == 
    a b c 
    1 2 3 
    == == == 

इसी docutils डॉक्स here देखें।

संबंधित मुद्दे