Home All Groups Group Topic Archive Search About
Author
21 Dec 2005 4:34 PM
Arne
ASP.net can create HTML tables with Datagrid and Table controls. Is there an
ASP.net control that allows me to build an HTML table with a THEAD row?

Author
21 Dec 2005 5:11 PM
Phillip Williams
Repeater.

Show quoteHide quote
"Arne" wrote:

> ASP.net can create HTML tables with Datagrid and Table controls. Is there an
> ASP.net control that allows me to build an HTML table with a THEAD row?
Author
21 Dec 2005 5:37 PM
Arne
Phillip

Can I access the <THEAD> in the repeater and add a style?

Arne

Show quoteHide quote
"Phillip Williams" wrote:

> Repeater.
>
> --
> HTH,
> Phillip Williams
> http://www.societopia.net
> http://www.webswapp.com
>
>
> "Arne" wrote:
>
> > ASP.net can create HTML tables with Datagrid and Table controls. Is there an
> > ASP.net control that allows me to build an HTML table with a THEAD row?
Author
21 Dec 2005 5:58 PM
Phillip Williams
Hi Arne,

Since the  Repeater control is the only Web control that allows you to split
markup tags across the templates. you can write something like this to get a
THEAD and TBODY section:

<asp:Repeater id=Repeater1 runat="server">
    <HeaderTemplate>
        <table border=1 id="table1">
        <THEAD >
        <tr>
           <th><b>Company</b></td>
           <th><b>Symbol</b></td>
        </tr>
        </THEAD>
        </TBODY>
    </HeaderTemplate>

    <ItemTemplate>
        <tr>
        <td> <%# DataBinder.Eval(Container.DataItem, "Name") %> </td>
        <td> <%# DataBinder.Eval(Container.DataItem, "Ticker") %> </td>
        </tr>
    </ItemTemplate>

    <FooterTemplate>
        </TBODY>
        </table>
    </FooterTemplate>
</asp:Repeater>

You can then style them like this:

<style>
#table1 thead td{
/*style definition for the cell within a thead*/
}
#table1 tbody td{
/*style definition for the cell within a tbody*/
}
</style>
Show quoteHide quote
"Arne" wrote:

> Phillip
>
> Can I access the <THEAD> in the repeater and add a style?
>
> Arne
>
> "Phillip Williams" wrote:
>
> > Repeater.
> >
> > --
> > HTH,
> > Phillip Williams
> > http://www.societopia.net
> > http://www.webswapp.com
> >
> >
> > "Arne" wrote:
> >
> > > ASP.net can create HTML tables with Datagrid and Table controls. Is there an
> > > ASP.net control that allows me to build an HTML table with a THEAD row?
Author
21 Dec 2005 6:06 PM
Phillip Williams
Correction:

The THEAD section should look like that instead:
        <THEAD >
        <tr>
           <th>Company</th>
           <th>Symbol</th>
        </tr>
        </THEAD>
and the equivalent style should be like this:
<style>
#table1 thead th{
  /*style definition for the cell within a thead*/
}
#table1 tbody td{
/*style definition for the cell within a tbody*/
}
</style>

Show quoteHide quote
"Phillip Williams" wrote:

> Hi Arne,
>
> Since the  Repeater control is the only Web control that allows you to split
> markup tags across the templates. you can write something like this to get a
> THEAD and TBODY section:
>
> <asp:Repeater id=Repeater1 runat="server">
>     <HeaderTemplate>
>         <table border=1 id="table1">
>         <THEAD >
>         <tr>
>            <th><b>Company</b></td>
>            <th><b>Symbol</b></td>
>         </tr>
>         </THEAD>
>         </TBODY>
>     </HeaderTemplate>
>
>     <ItemTemplate>
>         <tr>
>         <td> <%# DataBinder.Eval(Container.DataItem, "Name") %> </td>
>         <td> <%# DataBinder.Eval(Container.DataItem, "Ticker") %> </td>
>         </tr>
>     </ItemTemplate>
>
>     <FooterTemplate>
>         </TBODY>
>         </table>
>     </FooterTemplate>
> </asp:Repeater>
>
> You can then style them like this:
>
> <style>
> #table1 thead td{
>  /*style definition for the cell within a thead*/
> }
> #table1 tbody td{
> /*style definition for the cell within a tbody*/
> }
> </style>
> --
> HTH,
> Phillip Williams
> http://www.societopia.net
> http://www.webswapp.com
>
>
> "Arne" wrote:
>
> > Phillip
> >
> > Can I access the <THEAD> in the repeater and add a style?
> >
> > Arne
> >
> > "Phillip Williams" wrote:
> >
> > > Repeater.
> > >
> > > --
> > > HTH,
> > > Phillip Williams
> > > http://www.societopia.net
> > > http://www.webswapp.com
> > >
> > >
> > > "Arne" wrote:
> > >
> > > > ASP.net can create HTML tables with Datagrid and Table controls. Is there an
> > > > ASP.net control that allows me to build an HTML table with a THEAD row?