?
Solved

align datalist item to one line

Posted on 2010-11-09
4
Medium Priority
?
483 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 57

Expert Comment

by:HainKurt
ID: 34098756
post aspx code first...
0
 
LVL 57

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 57

Accepted Solution

by:
HainKurt earned 2000 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

777 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