Solved

ASP.NET Repeater Control - Can't  get columns to align when a cell is empty

Posted on 2004-10-07
2
365 Views
Last Modified: 2011-10-03
When the data is displayed in my repeater control, the columns aren't perfectly aligned when there is no value in one of the cells. For the table layout, I've used pixels and percentages for the columns and nothing is working. Here's the table layout....

<asp:Repeater id="parentrepeater" runat="server">
<itemtemplate>
<TABLE style="FONT-SIZE: 8pt; FONT-FAMILY: 'Microsoft Sans Serif'" width="750" border="1">
<tr><td width="8%" valign="top" align="left"><%# DataBinder.Eval (Container.DataItem, "projectid" ) %></td>
<td width="15%" valign="top" align="left"><%# DataBinder.Eval(Container.DataItem, "NewName") %></td>
<td width="15%" valign="top" align="left"><%# DataBinder.Eval(Container.DataItem, "prjleadfnm") %>&nbsp;<%# DataBinder.Eval(Container.DataItem, "prjleadlnm") %></td>
<td width="15%" valign="top" align="left"><%# DataBinder.Eval(Container.DataItem, "busleadfnm") %>&nbsp;<%# DataBinder.Eval(Container.DataItem, "busleadlnm") %></td>
<td width="5%" valign="top" align="center"><%# DataBinder.Eval(Container.DataItem, "priority") %></td>
<td width="15%" valign="top" align="left"><%# DataBinder.Eval(Container.DataItem, "corpinitnbr") %>&nbsp;<%# DataBinder.Eval(Container.DataItem, "corpinitnm") %></td>
<td width="10%" valign="top" align="left">
</table>
</ItemTemplate>
</asp:Repeater>

Any suggestions for me?

Thanks!
0
Comment
Question by:khawkins96
2 Comments
 
LVL 33

Accepted Solution

by:
raterus earned 125 total points
ID: 12250407
You are making the full table in the itemtemplate.  Keep in mind that this is repeated x number of times, so in the end, you have x number of tables.  Since they are all separate, it would be very hard to align everythign perfectly, unless you use pixels (I wouldn't go there)

What you can do is use a DataList control, rather than a repeater.  It is a step up, but everything gets repeated in ONE table.  That should fix your problem.
0
 

Author Comment

by:khawkins96
ID: 12251178
Thanks. I"ll give that a try.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now