Solved

align datalist item to one line

Posted on 2010-11-09
4
473 Views
Last Modified: 2012-05-10
attached image are datalist with alignment misplaced, trying to align so that the view and create images are aligned with the description and title. align datalist
0
Comment
Question by:doramail05
[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
  • 3
4 Comments
 
LVL 53

Expert Comment

by:Huseyin KAHRAMAN
ID: 34098756
post aspx code first...
0
 
LVL 53

Expert Comment

by:Huseyin KAHRAMAN
ID: 34098762
or use

Style="vertical-align: middle;" in all td's...
0
 
LVL 1

Author Comment

by:doramail05
ID: 34098883
here they are :
<tr valign="top">
                                        <td>
                                            <div style="padding-left:50px">
                                            <asp:Datalist ID="dlarticle" runat="server" Height="33px" Width="600px">
                                                            <ItemTemplate>
                                                            <fieldset>
                                                            <table>
                                                                <tr>
                                                                    <td width="20px" background="images/round_rectangletopleft.png"></td>
                                                                    <td></td>
                                                                    <td width="20px" background="images/round_rectangletopright.png"></td>
                                                                </tr>
                                                                <tr>
                                                                    <td width="20px" background="images/round_rectangleleft.png"></td>
                                                                    <td>
                                                                    <div style="float:left; padding-left:10px">
                                                                    
                                                                    <%# DataBinder.Eval(Container.DataItem, "a_categoryname")  %>
                                                                    
                                                                      

                                                                    
                                                                    </div>
                                                                    <div style="padding-left:100px">
                                                                    
                                                                    <%# DataBinder.Eval(Container.DataItem, "a_desc") %>
                                                                    
                                                                    

                                                                    </div>
                                                                    

                                                                    <div style="float:left;padding-left:650px">
                                                                    <HeaderTemplate>
                                                                        View
                                                                    </HeaderTemplate>

                                                                    <ItemTemplate>
                        
                                                                        <asp:LinkButton ID="lbCreatePost" runat="server" 
                                                                                CommandName="CREATEPOST" CssClass="note" CommandArgument='<%#
                                                                                DataBinder.Eval(Container.DataItem, "id") %>'></asp:LinkButton>
                                                                                
                                                                                
                                                                               
                                                                    </ItemTemplate>
                                                                    </div>
                                                                    <div style="float:left;padding-left:720px;">
                                                                    <HeaderTemplate>
                                                                        Create
                                                                    </HeaderTemplate>

                                                                    <ItemTemplate>
                                                                    <asp:LinkButton ID="lbEditPost" runat="server" 
                                                                                CommandName="EDITPOST" CssClass="editnote" CommandArgument='<%#
                                                                                DataBinder.Eval(Container.DataItem, "id") %>'></asp:LinkButton>
                                                                    </ItemTemplate>
                                                                    </div>

                                                                    </td>
                                                                    <td width="20px" background="images/round_rectangleright.png"></td>
                                                                </tr>
                                                                <tr>
                                                                    <td width="20px" background="images/round_rectanglebottomleft.png"></td>
                                                                    <td></td>
                                                                    <td width="20px" background="images/round_rectanglebottomright.png"></td>
                                                                </tr>
                                                            </table>

                                                             </fieldset>
                                                           </ItemTemplate>
                                                        </asp:Datalist>
                                            </div>
                                        </td>
                                    </tr>

Open in new window

0
 
LVL 53

Accepted Solution

by:
Huseyin KAHRAMAN earned 500 total points
ID: 34101780
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.datalist.aspx

why do you have multiple ItemTemplate & HeaderTemplate? they should be one...

make it simple and remove all unnecessary div tags... first try to put everything in a simple table like below, and then apply it to your data list...
<table>
	<colgroup>
	<col width=100 valign=top>
	<col width=300 valign=top>
	<col width=50 valign=top>
	<col width=50 valign=top>
	</colgroup>
	<tr>
		<td>Name</td>
		<td>Desc</td>
		<td>View</td>
		<td>Edit</td>
	<tr>
	<tr>
		<td>C#</td>
		<td>C# for dummies</td>
		<td><img src="http://www.psychpress.com.au/psychometric/images/icon_view.gif"></td>
		<td><img src="http://www.weekrent.com/germany/gif/edit.gif"></td>
	<tr>
	<tr>
		<td>VB.Net</td>
		<td>Programming in VB.Net for dummies</td>
		<td><img src="http://www.psychpress.com.au/psychometric/images/icon_view.gif"></td>
		<td><img src="http://www.weekrent.com/germany/gif/edit.gif"></td>
	<tr>
	<tr>
		<td>SQL</td>
		<td>Be SQL guru in 21 Hours</td>
		<td><img src="http://www.psychpress.com.au/psychometric/images/icon_view.gif"></td>
		<td><img src="http://www.weekrent.com/germany/gif/edit.gif"></td>
	<tr>
</table>

Open in new window

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
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 …

738 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