2012-11-22 34 views
0

enter image description hereenter image description here我拉我的頭髮以找到此代碼中的錯誤,我的表列正在切割成兩行,但我想在單行顯示列數據。同樣的表格用於在其他Senario中顯示數據並正常工作。我相信列數據「數據不可用」將內容分成兩行,任何輸入都將非常有幫助。在XSL中的表列拆分問題

<table style="width=73%;table-layout:auto" border="0" white-space-collapse="false" wrap-option="no-wrap" white-space="nowrap"> 
<xsl:for-each select="webpage/param">  
    <tr> 
    <xsl:if test="@type !='i'"> 
    <td class="rowBlue"> 
    <xsl:if test="@indent !=''"> 

     <!-- Generate the appropriate number of indentation --> 
     <xsl:variable name="count" select="@indent"/> 
     <xsl:for-each select="(//*)[position()&lt;=$count]"> 
      <xsl:text>&#xa0;</xsl:text> 
     </xsl:for-each> 

    </xsl:if>   
    <xsl:choose>    
     <xsl:when test="@isBold='1'"> 
      <strong><span id="{position()-1}{@nameStrID}"><xsl:value-of select="@name"/></span></strong> 
     </xsl:when> 
     <xsl:otherwise> 
      <span id="{position()-1}{@nameStrID}"><xsl:value-of select="@name"/></span> 
     </xsl:otherwise>  
    </xsl:choose> 
    <xsl:text>&#xa0;</xsl:text> 
    <xsl:text>&#xa0;</xsl:text> 
    <xsl:text>&#xa0;</xsl:text> 
    <xsl:text>&#xa0;</xsl:text> 
    <xsl:text>&#xa0;</xsl:text> 
    <xsl:text>&#xa0;</xsl:text> 
    <xsl:text>&#xa0;</xsl:text> 
    <xsl:text>&#xa0;</xsl:text> 
    <xsl:text>&#xa0;</xsl:text> 
    <xsl:text>&#xa0;</xsl:text>   
    </td> 
    </xsl:if>   
+1

是 「數據沒有」 後插入一個BR標籤?你可以嘗試添加CSS「white-space:nowrap;」到運輸署,看看是否有幫助。 –

+0

我試過,但沒有得到水果 – Sijith

回答

1

嘗試使用風格

<span style="white-space: nowrap;" id="{position()-1}{@nameStrID}"> 
    <xsl:value-of select="@name"/></span> 
+0

對不起,提問這個基本的問題,我要試試這個區域 – Sijith

+0

風格就像C++中的類一樣,我可以給