Solved

align datalist item to one line

Posted on 2010-11-09
4
465 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
ID: 34098756
post aspx code first...
0
 
LVL 51

Expert Comment

by:HainKurt
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 51

Accepted Solution

by:
HainKurt 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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

830 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