You are currently offline, waiting for your internet to reconnect

Your browser is out-of-date

You need to update your browser to use the site.

Update to the latest version of Internet Explorer

How to make every other row in an XSLT Data View Web Part a different color in SharePoint Designer 2007, in Expression Web, and in FrontPage 2003

Support for Office 2003 has ended

Microsoft ended support for Office 2003 on April 8, 2014. This change has affected your software updates and security options. Learn what this means for you and how to stay protected.

SUMMARY
This article discusses how to format rows in an Extensible Style sheet Language Transformations (XSLT) Data View so that every other row is a different color when you use Microsoft Office SharePoint Designer 2007, Microsoft Expression Web, and Microsoft Office FrontPage 2003.
MORE INFORMATION

SharePoint Designer 2007 and Expression Web

In SharePoint Designer 2007 and in Expression Web, you can apply conditional XSLT formatting for information in a Data view that is being returned from an XML data source. For example, a Data view may include data that is contained in a static XML file or that comes from a Microsoft Windows SharePoint Services list.

To modify the XSLT to make every other row in the Data view a different color, follow these steps:
  1. Click in any table cell that contains XML data.
  2. On the Table menu, point to Select, and then click Row.
  3. Click the Task Panes menu, and then click Conditional Formatting.
  4. In the Conditional Formatting task pane, click Apply Formatting on the Create menu.
  5. In the Condition Criteria dialog box, click Click here to add a new clause.
  6. In the Field Name column, click [Row Number].
  7. In the Condition column, click IsOdd.
  8. Click OK.
  9. In the Modify Style dialog box, click Background.
  10. In the Background area, click the Gray color swatch in the Background-color menu.
  11. Click OK two times to return to the design surface in FrontPage.
Every other row is now gray.

FrontPage 2003

In FrontPage 2003, you can apply conditional XSLT formatting for information in a Data view that is being returned from an XML data source. For example, a Data view may include data that is contained in a static XML file or that comes from a Windows SharePoint Services list.

To modify the XSLT to make every other row in the Data view a different color, follow these steps:
  1. Click in any table cell that contains XML data.
  2. On the Table menu, click Select, and then click Row.
  3. Click the Data menu, and then click Conditional Formatting.
  4. In the Conditional Formatting task pane, click Apply Formatting in the Create section.
  5. In the Condition Criteria dialog box, click [Row Number] in the Field Name area .
  6. Click IsOdd, and then click OK.
  7. In the Modify Style dialog box, click Format, and then click Border.
  8. In the Borders and Shading dialog box, click Shading.
  9. In the Shading dialog box, click Gray.
  10. Click OK two times to return to the design surface in FrontPage.
Every other row is now gray.
kbnoOfficeAlertID SPD2007 EW EWD FP2003 WSS SPS
Properties

Article ID: 831095 - Last Review: 06/01/2007 19:56:45 - Revision: 3.2

  • Microsoft Office SharePoint Designer 2007
  • Microsoft Expression Web
  • Microsoft Office FrontPage 2003
  • kbview kbformat kbxml kbinfo kbhowto KB831095
Feedback
>>ript' src='" + (window.location.protocol) + "//c.microsoft.com/ms.js'><\/script>");