Solved

align datalist item to one line

Posted on 2010-11-09
4
439 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
  • 3
4 Comments
 
LVL 51

Expert Comment

by:HainKurt
Comment Utility
post aspx code first...
0
 
LVL 51

Expert Comment

by:HainKurt
Comment Utility
or use

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

Author Comment

by:doramail05
Comment Utility
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 51

Accepted Solution

by:
HainKurt earned 500 total points
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Pick image, show data 4 33
Javascript newbie 5 36
What are the big features of MVC5? 4 49
How can I use this extension method? 8 34
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

728 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

9 Experts available now in Live!

Get 1:1 Help Now