Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I would like to display my search results in a table like fashion. Does anyone know any good technique that I can use to display my custom columns in a table fashion?

I used a html table, but it keeps repeating eventhough I used this:

<xsl:if test="(position())=1">

<tr>
<td>Address</td>
</tr>
</xsl:if>
<tr>
<td>content goes here</td>
</td>

it is still adding spaces between each row and it looks like separate tables. I would like it to look like a gridview, or like the one in a list or library.

Thank you for your help.

share|improve this question

1 Answer 1

It is certainly possible, however it would require to understand a little bit how the results are returned and then change the XSLT appropiately. I would suggest strongly to go through collecting the actual XML and use SharePoint Designer 2010 to change the output any way you see fit.

Basically you would need to collect the XML and add it a Data Source in SharePoint designer. Use this XSLT in your Core Search REsults web part to collect the actual output, before the XSLT transformation of the rendering.

<xsl:stylesheet version="1.0" 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> 
<xsl:template match="/"> 
  <xmp><xsl:copy-of select="*"/></xmp> 
</xsl:template> 
</xsl:stylesheet>

Tobias Zimmerman has a series of articles, which is still viable for SharePoint 2010. Find it here http://zimmergren.net/technical/moss-2007-customize-the-search-result-using-xslt-part-3-customize-using-sharepoint-designer-2007

share|improve this answer

Your Answer

 
discard

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.