Solved

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

Posted on 2004-10-07
2
363 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

760 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

19 Experts available now in Live!

Get 1:1 Help Now