Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 25064

How to display 2 records per row in XSLT (code included)

$
0
0

I want to display 2 records per row from a list in my SharePoint site.

I am using XSLT. This is how I want to display records:

<tr>
    <td>Record1</td>
    <td>Record2</td>
</tr>
<tr>
    <td>Record3</td>
    <td>Record4</td>
</tr>

I have written the following code to do this job but getting error on line where <tr> is written. Basically XSLT is not allowing me to write <tr> without closing </tr>. But I want it that way otherwise my logic won't work. So is there a way to achieve this?

CODE

<xsl:choose>
    <xsl:when test="position() mod 2 = 1">
        <tr> (this is my error line)
    </xsl:when>
</xsl:choose>

<td>rest of my code will come here</td>

<xsl:choose>
    <xsl:when test="position() mod 2 = 0">
        </tr>
    </xsl:when>
</xsl:choose>


Viewing all articles
Browse latest Browse all 25064

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>