Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 05-26-2005, 12:07 PM   #1 (permalink)
brendalisalowe
Registered User
 
Join Date: May 2005
Posts: 9
brendalisalowe is on a distinguished road
columns don't line up in Datalist...

I have an ASP datalist, but I can't get the columns to all line up right. How do I do it? I'm using tables but it doesn't work right. Here is my code (sorry it is so much):

Code:
<asp:DataList id="DataList1" Runat="server" BorderColor="black" EnableViewState="True" CellSpacing="0"
						Font-Name="Times New Roman" Font-Size="8pt" HeaderStyle-BackColor="#aaaadd" AlternatingItemStyle-BackColor="Gainsboro"
						EditItemStyle-BackColor="lightgreen" OnEditCommand="DataList_EditCommand" OnCancelCommand="DataList_CancelCommand"
						BorderWidth="1" CellPadding="1" OnUpdateCommand="DataList_UpdateCommand" DataKeyField="ConsumerAccountNumber"
						HorizontalAlign="Center" Gridlines="Both" Width="100%" ItemStyle-Width="20%" OnDeleteCommand="DataList_DeleteCommand">
						<HeaderTemplate>
							<table width="100%">
								<tr>
									<th align="left">
										<font size="2">
											<asp:LinkButton OnClick="SortAccountNo" Runat="server">Account No</asp:LinkButton>
										</font>
									</th>
									<th align="left">
										<font size="2">
											<asp:LinkButton OnClick="SortLastName" Runat="server">Last Name</asp:LinkButton>
										</font>
									</th>
									<th align="left">
										<font size="2">First Name</font>
									</th>
									<th align="left">
										<font size="2">Address</font>
									</th>
									<th align="left">
										<font size="2">Address (Line 2)</font>
									</th>
									<th align="left">
										<font size="2">City</font>
									</th>
									<th align="left">
										<font size="2">State</font>
									</th>
								</tr>
							</table>
						</HeaderTemplate>
						<ITEMTEMPLATE>
							<TABLE width="100%">
								<TR>
									<TD align="center" width="70"><FONT size="2"><%# DataBinder.Eval(Container.DataItem, "ConsumerAccountNumber")  %></FONT></TD>
									<TD align="center" width="70"><FONT size="2"><%# DataBinder.Eval(Container.DataItem, "LastName")  %></FONT></TD>
									<TD align="center" width="70"><FONT size="2"><%# DataBinder.Eval(Container.DataItem, "FirstName")  %></FONT></TD>
									<TD align="center" width="70"><FONT size="2"><%# DataBinder.Eval(Container.DataItem, "FirstLineOfAddress")  %></FONT></TD>
									<TD align="center" width="70"><FONT size="2"><%# DataBinder.Eval(Container.DataItem, "SecondLineOfAddress")  %></FONT></TD>
									<TD align="center" width="70"><FONT size="2"><%# DataBinder.Eval(Container.DataItem, "City")  %></FONT></TD>
									<TD align="center" width="70"><FONT size="2"><%# DataBinder.Eval(Container.DataItem, "State")  %></FONT></TD>
								</TR>
								<TR>
									<TD>
										<asp:LinkButton id="button1" runat="server" CommandName="edit" Text="Edit"></asp:LinkButton></TD>
									<TD>
										<asp:LinkButton id="Linkbutton5" runat="server" CommandName="delete" Text="Delete"></asp:LinkButton></TD>
								</TR>
							</TABLE>
						</ITEMTEMPLATE>
						<EDITITEMTEMPLATE>
							<TABLE width="100%">
								<TR>
									<TD align="center"><FONT size="2"><%# DataBinder.Eval(Container.DataItem, "ConsumerAccountNumber") %></FONT></TD>
									<TD align="center" width="70">
										<asp:TextBox id=txtLastName runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "LastName")  %>'>
										</asp:TextBox></TD>
									<TD align="center" width="70">
										<asp:TextBox id=txtFirstName runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "FirstName")  %>'>
										</asp:TextBox></TD>
									<TD align="center" width="70">
										<asp:TextBox id=txtAddress runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "FirstLineOfAddress")  %>'>
										</asp:TextBox></TD>
									<TD align="center" width="70">
										<asp:TextBox id=txtAddress2 runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "SecondLineOfAddress")  %>'>
										</asp:TextBox></TD>
									<TD align="center" width="70">
										<asp:TextBox id=txtCity runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "City")  %>'>
										</asp:TextBox></TD>
									<TD align="center" width="70">
										<asp:DropDownList id="ddlState" runat="server">
											<asp:ListItem>AZ</asp:ListItem>
										</asp:DropDownList></TD>
								</TR>
								<TR>
									<TD>
										<asp:LinkButton id="button2" runat="server" CommandName="update" Text="Update"></asp:LinkButton></TD>
									<TD>
										<asp:LinkButton id="button3" runat="server" CommandName="cancel" Text="Cancel"></asp:LinkButton></TD>
								</TR>
							</TABLE>
						</EDITITEMTEMPLATE>
					</asp:DataList>
Thanks!
brendalisalowe is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get the line class working, it does not calculate for some reason latin_papi Standard C, C++ 1 05-11-2005 10:57 PM
scripting with php: new line sde Linux / BSD / OS X 9 02-16-2005 05:04 PM
writting progress to cl on one line sde Linux / BSD / OS X 4 11-08-2004 01:15 PM
cgi script Henry PHP 25 12-30-2002 06:54 AM


All times are GMT -8. The time now is 01:57 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting