SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is a follow up to How to distribute People Search Core Results over two columns using XSL,

When I use the suggested code block in that article

    <xsl:for-each select="All_Results/Result">
         <xsl:if test="position() mod 2 = 1">
              <div style="width:50%;float:left;"><xsl:call-template name="SingleResult"/></div>
         <xsl:if test="position() mod 2 = 0">
              <div style="width:50%;float:right;"><xsl:call-template name="SingleResult"/></div>            <div style="clear: both;"></div>

I end up with

Any suggestions on how to get the results
1 | 2
3 | 4

Thank you.

share|improve this question

The code you posted includes the following after the right column

<div style="clear: both;"></div>

Is this perhaps making your content wrap since you have the widths of your first two divs set to 50%.

share|improve this answer
<div style="width: 100%">    
 <xsl:for-each select="All_Results/Result">
   <div style="width:50%;float:left;"><xsl:call-template name="SingleResult"/></div>

Assuming there is no other styling then this should work fine as it will fill the container div with two at 50% and then wrap to the next line. What you are seeing is what usually happens if you have some padding or margin which means that two divs at 50% are actually more than the 100% outer div.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.