Solved

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

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

680 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