Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Listing Records Side by Side
Message
From
05/02/2003 09:26:43
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:
00749326
Views:
26
David,

Thanks for the response. I tried your suggestion and it's not what I want, so I'll better explain what I want. Let's say there are 10 records in my XML file. I want to display them in groups of two, so records 1 and 2 would be on row 1, records 3 and 4 would be on row 2 and so on. Do you understand what I'm getting at? Is there a way to do this?



>>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>
>
Thanks

Jim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform