2013-02-07 2 views
1

내 문제가 있습니다 : 내 사이트의 제품에 xslt를 사용하여 테이블을 만들어야합니다.XSL for each. tr 태그의 잘못된 출력

How should it looks

지금은 다음과 같습니다 :

Looks now

그래서, 내 질문은 <tr> 태그 사이에 이러한 분할 선을 수행하는 방법입니다 여기 가 어떻게 보이는지해야입니까?

<table id="producers_table" > 

     <xsl:for-each select="document('udata://catalog/getCategoryList/void/producers//1/')/udata/items/item[not(@country=preceding-sibling::item/@country)]" > 

     <xsl:variable name="country_name" select="@country" /> 
     <xsl:variable name="country_count" select="count($country_name)"/> 

     <tr id="test"> 

     <td id="country_td"> 
     <xsl:value-of select="document(concat('uobject://', $country_name))/udata/object/@name"/> 

     </td>  

     <xsl:for-each select="../item[@country = $country_name]"> 

    <xsl:variable name="prod_count" select="document(concat('udata://catalog/getCountObjects/', @id))/udata"/> 

          <td umi:element-id="{@id}"> 

              <a href="{@link}" umi:field-name="name" umi:delete="delete" umi:empty="&empty-section-name;"> 
       <table class="object_table"> 
       <tr> 
       <td align="center">  
<img src="{document(concat('upage://', @id, '.header_pic'))//value}"/> 
</td> 
</tr> 
<tr> 
    <td align="center" id="search_by_appointment_name"> 
     <p> 
    <span><xsl:variable name="curr_producer_name" select="."/> 
    <xsl:value-of select="$curr_producer_name" /> 
</span> 


&#160;<sup class="object_count"><xsl:value-of select="$prod_count"/></sup> 
</p> 
</td> 
</tr> 
</table> 
    </a> 
    </td> 
     </xsl:for-each> 
</tr> 

</xsl:for-each> 

</table> 

내가 추가해야 <hr/> : 여기

enter image description here

내 코드?

P.

1.

Attempt 1

코드 :

<table id="producers_table" > 

    <xsl:for-each select="document('udata://catalog/getCategoryList/void/producers//1/')/udata/items/item[not(@country=preceding-sibling::item/@country)]" > 

    <xsl:variable name="country_name" select="@country" /> 
    <xsl:variable name="country_count" select="count($country_name)"/> 

    <tr id="test"> 
     **<hr/>** 

2.

Attempt 2

&#160;<sup class="object_count"><xsl:value-of select="$prod_count"/></sup> 
</p> 
</td> 
</tr> 
</table> 
    </a> 
    </td> 
     </xsl:for-each> 
     **<hr/>** 
</tr> 

</xsl:for-each> 

</table> 

답변

2
여기 내 시도의 일부 결과입니다

HTML의 경우 을 <tr>에 직접 삽입하는 것은 적합하지 않습니다. 당신은 두 번째 <xsl:for-each> 전에이 권리를 넣어 시도 할 수 :

<tr> 
    <td colspan="10"> 
    <hr /> 
    </td> 
</tr> 

그러나이 시대에

, 당신은 레이아웃을 위해 테이블을 사용해서는 안됩니다. 여기 올바른 해결책은 HTML을 재 작업하여 테이블 대신 <div>을 사용하는 것이라고 생각합니다. 그렇다면 원하는 위치에 <hr/>을 넣는 것이 쉽습니다.

2

td의 스타일 태그에 CSS 클래스를 작성하면 border-bottom: 1px solid gray입니다. 그게 당신이가는 효과를 가져와야합니다.

관련 문제