Re: HTML Table with Dynamic Columns
From: Cor Ligthert (notmyfirstname_at_planet.nl)
Date: 12/28/04
- Next message: Umpty: "Syntax Problem in Code using SCOPE() function"
- Previous message: Cor Ligthert: "Re: Winforms DataGrid reference?"
- In reply to: Fresh Air Rider: "HTML Table with Dynamic Columns"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 28 Dec 2004 17:22:58 +0100
Hi,
In addition to Rakesh,
Did you already look at the repeater
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebUIWebControlsRepeaterClassTopic.asp
I hope this helps?
Cor
"Fresh Air Rider" <Fresh_Air_Rider@Hotmail.com>
> Hello
>
> Does anyone know how to display data from a data source such as an
> array or SqlDataReader etc within an HTML table whose number of
> columns can change according to the value of a variable ?
>
> This is one thing that XSL is brilliant at but I can't find a nice
> .Net solution
>
> The following is how it can easily be achieved in XSL.
>
> -------- XML file -------------
>
> <root>
> <letter>a</letter>
> <letter>b</letter>
> <letter>d</letter>
> <letter>c</letter>
> <letter>f</letter>
> <letter>e</letter>
> <letter>g</letter>
> <letter>h</letter>
> <letter>i</letter>
> </root>
>
> ------- XSL file --------------
>
> <xsl:template match="root">
> <xsl:variable name="columns" select="6" />
> <TABLE>
> <xsl:for-each select="letter[position() mod $columns = 1]">
> <TR>
> <xsl:for-each select=".|following-sibling::letter[position()
> < $columns]">
> <TD>
> <xsl:value-of select="." />
> </TD>
> </xsl:for-each>
> </TR>
> </xsl:for-each>
> </TABLE>
> </xsl:template>
- Next message: Umpty: "Syntax Problem in Code using SCOPE() function"
- Previous message: Cor Ligthert: "Re: Winforms DataGrid reference?"
- In reply to: Fresh Air Rider: "HTML Table with Dynamic Columns"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|