Solved

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

Posted on 2004-10-07
2
368 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

631 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