Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rik Hodiamont 56 posts 156 karma points
    Apr 13, 2012 @ 11:38
    Rik Hodiamont
    0

    RepeatColumns

    Hi,

    I have a question. Could you give me soms hints about solving the following problem.

    I want to show the results not in a list but in a list with three columns. So:

    1 2 3

    4 5 6

    7 8 9

    How can I do this with XSLT? I created a loop but how can start a new line when element 3 has been shown.

    Thanks in advance!

  • Fergus Davidson 309 posts 588 karma points
    Apr 13, 2012 @ 11:55
    Fergus Davidson
    0

    if this is being displayed in a 'ul', i would has the li elements floated left with an additional 'col1' class which would clear the float.

    li {display:block; width:100px; float:left;}

    li.cl {clear:left;}

    Then in the XSLT, you could, within your loop have something like:

    <xsl:if test="position() mod 3 = 1">
      <xsl:attribute name="class">cl</xsl:attribute>
    </xsl:if>

    this is not tested, but might get you started.

Please Sign in or register to post replies

Write your reply to:

Draft