I need to display images in a list horizontally one after other. How can this be done in a dataview webpart in SharePoint 2010?


The easiest way I know of to do this is to put each image in a div and then use css to float those divs left. SharePoint already has a float:left class you can tie into: "image-area-left". So your item style in xsl would look like this:

<xsl:template name="dvt_1.rowview">
  <div class="image-area-left">
    <img class="image" src="{@FileRef}" alt="{@Title}"></img>

Note: in order to have the divs work, you'll have to probably remove the table that wraps typical DVWPs in 2010. I don't have a working 2010 environment to test on, but if you paste your XSL in here I can certainly help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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