Re: HTML Table with Dynamic Columns

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Cor Ligthert (notmyfirstname_at_planet.nl)
Date: 12/28/04


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()
> &lt; $columns]">
> <TD>
> <xsl:value-of select="." />
> </TD>
> </xsl:for-each>
> </TR>
> </xsl:for-each>
> </TABLE>
> </xsl:template>



Relevant Pages

  • RE: HTML Table with Dynamic Columns
    ... Rakesh Rajan ... "Fresh Air Rider" wrote: ... > Does anyone know how to display data from a data source such as an ... > The following is how it can easily be achieved in XSL. ...
    (microsoft.public.dotnet.general)
  • HTML Table with Dynamic Columns
    ... Does anyone know how to display data from a data source such as an ... array or SqlDataReader or XML etc within an HTML table whose number of ... The following is how it can easily be achieved in XSL. ...
    (microsoft.public.dotnet.xml)
  • HTML Table with Dynamic Columns
    ... 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 ... The following is how it can easily be achieved in XSL. ...
    (microsoft.public.dotnet.general)
  • HTML Table with Dynamic Columns
    ... 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 ... The following is how it can easily be achieved in XSL. ...
    (microsoft.public.dotnet.csharp.general)
  • Xpath with XMLDatasource
    ... i am trying to use XPath and the XMLDataSource to display data from an ... repeater display a label for Seed, label for Team Name and a Text Box ... I have created an XMLDataSource like so: ...
    (microsoft.public.dotnet.framework.aspnet)