Re: DataList column alignment?
- From: intrader <intrader@xxxxxxxxxxxxx>
- Date: Wed, 22 Jun 2005 21:54:37 GMT
On Wed, 22 Jun 2005 06:34:03 -0700, Ben Fidge wrote:
> I'm using DataList to present tabular data but am often having problems with
> some rows column alignment being out of synch with the rest of the rows.
>
> My DataList looks similar to this...:
>
> <asp:datalist id="DataList1" runat="server">
> <HeaderTemplate>
> <table border="0" cellpadding="0" cellspacing="0" width="400">
> <tr>
> <td width="100">First Name</td>
> <td width="100">Surname</td>
> <td width="100">DOB</td>
> <td width="100">Gender</td>
> </tr>
> </table>
> </HeaderTemplate>
> <ItemTemplate>
> <table>
> <tr>
> <td width="100"><%# DataBinder.Eval(Container.DataItem,
> "firstname") %></td>
> <td width="100"><%# DataBinder.Eval(Container.DataItem,
> "surname") %></td>
> <td width="100"><%# DataBinder.Eval(Container.DataItem, "dob")
> %></td>
> <td width="100"><%# DataBinder.Eval(Container.DataItem,
> "gender") %></td>
> </tr>
> </table>
> </ItemTemplate>
> </asp:datalist>
>
> ...but if any data exceeds the maximum width of it's column, that particular
> "cell" is getting expanded to accomodate the data. I think the problem lies
> in using tables in the <ItemStyle> tags, so for each row, the table is
> automatically altered to accomodate the data it hold. Of course, this makes
> the final output look unprofessional.
>
> Is there any way round this?
>
> Thanks
> Ben
The Header should have the table but not the table end. There should not
be a table in the ItemTemplate (unless it is for another purpose)
.
- References:
- DataList column alignment?
- From: Ben Fidge
- DataList column alignment?
- Prev by Date: Re: Absolute ReturnUrl in Asp.Net 1.1
- Next by Date: Re: Absolute ReturnUrl in Asp.Net 1.1
- Previous by thread: Re: DataList column alignment?
- Next by thread: Re: AUTHORIZATION with WINDOWS AUTHENTICATION -- HELP!!
- Index(es):
Relevant Pages
|