Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Listing Records Side by Side
Message
 
To
04/02/2003 11:04:22
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, United States
General information
Forum:
ASP.NET
Category:
XML
Miscellaneous
Thread ID:
00748888
Message ID:
00749004
Views:
23
>All,
>
> I want to create a style sheet that will list data in a table. I want the table to have two columns and list records side by side. Is this possible? Does anyone have an example of what the XSLT code would be?

You can create a standard html table and embed the xml values in the columns.
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

    <xsl:template match="/">
    <table width="210" border="1pt" cellspacing="0" cellpadding="3" bordercolor="#dddddd" style="border-collapse:collapse;">
        <tr>
            <th align="left">Product <br/>Category</th>
            <th>Revenue (Millions)</th>
            <th>Growth</th>
        </tr>
        <xsl:for-each select='sales/product'>
            <tr>
                <td class="Normal" width="100">
                    <i><xsl:value-of select='@id'/></i>
                </td>
                <td class="Normal">
                    <CENTER>
                        <xsl:value-of select='revenue'/>
                    </CENTER>
                </td>
                <td class="Normal">
                    <xsl:if test='growth < 0'>
                        <xsl:attribute name='style'>
                            <xsl:text>color:red</xsl:text>
                        </xsl:attribute>
                    </xsl:if>
                    <CENTER>
                        <xsl:value-of select='growth'/>
                    </CENTER>
                </td>
            </tr>
        </xsl:for-each>
    </table>
    </xsl:template>
</xsl:stylesheet>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform