More than 2 columns in SharePoint Data view

November 13th, 2006 | Categories: Free tools

If you insert a SharePoint Data View Web Part (DVWP) in a page using FrontPage or SharePoint Designer, you have some nice layout options. A lot of times I like to make a web gallery using picture library, but the DVWP has only a two-column layout. If you’d like to have more columns (for this example, let’s make 4 columns), here’s an easy way.

  1. When selecting layout of DVWP (in FrontPage select smart tag and click Style, in SharePoint Designer select Smart tag and select Change Layout), chose the two column layout:

  2. Next in source code look for mod 2 (you’ll find 2 occurences)
  3. Replace the number 2 in both of those occurences with the number of columns you wish (for our example we’ll make mod 4)
  4. At the end change or remove the width property of the table cell, which is set to 50%
    – Using tag selector select the element which is holding table with details
  5. Delete or correct the “Width” attribute, because you have more columns and each can’t have 50% of width.

And there you have it. You’re in control of columns now 🙂