Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In a td element block as show below, there are 2 asp.net controls. I want to have space between both, and make the 2nd control (asp:HyperLink here) on the righ-side of the tr block. Could someone help me for its css? Thanks.
ASP.NET
<div id="header"  dojotype="dijit.layout.ContentPane" region="top">
      <tr>
	   <h1 style="height:30px;" >Locate A Point or A Segment on Route</h1>
      </tr>
      <tr>
           <td cospan="3" style="border-removed olive thick solid; height:15px;">      
              <asp:Label ID="LabelHeader2" runat="server" Text="WMATA GIS Application" style="width:350px; padding-left:10px;"></asp:Label>
              <asp:HyperLink ID="HyperLink3" Text="Help"
                            ToolTip = "Help for the Application" 
                            href="PDFs/Editor.pdf" runat="server" 
                            style="height: 20px; width: 25px; padding-right:5px; margin-top:0px;">
               </asp:HyperLink>
            </td>
      </tr>
</div>
Posted

inside TD take one more table like this <table><tr><td>first asp control</td><td>second Asp control</td></tr><table>

And align the first td as left and second as right.It will solve your problem
 
Share this answer
 
v2
Comments
[no name] 31-Jan-14 9:52am    
Wonderful! Works well!
Use css rule "float:right" on your HyperLink ;)
 
Share this answer
 
Comments
[no name] 31-Jan-14 9:53am    
I tried Solution 1. Yours should also work well with some additional code. Thanks.
Ahmed Bensaid 31-Jan-14 10:08am    
You are welcome ;)
But you don't need additional code. Example :
<table style="border:solid 1px black">
<tr>
<td style="width:400px">
<asp:Label ID="LabelHeader2" runat="server" Text="WMATA GIS Application" style="width:350px; padding-left:10px;">
<asp:HyperLink ID="HyperLink3" Text="Help"
ToolTip = "Help for the Application"
href="PDFs/Editor.pdf" runat="server"
style="float:right;height:20px;width:25px;padding-right:5px;margin-top:0px;">

</td>
</tr>
</table>
XML
<div id="header"  dojotype="dijit.layout.ContentPane" region="top">
      <tr>
       <h1 style="height:30px;" >Locate A Point or A Segment on Route</h1>
      </tr>
      <tr>
           <td cospan="3" style="border-removed olive thick solid; height:15px;">
              <asp:Label ID="LabelHeader2" runat="server" Text="WMATA GIS Application" style="width:350px; padding-left:10px;"></asp:Label>
              <asp:HyperLink ID="HyperLink3" Text="Help"
                            ToolTip = "Help for the Application"
                            href="PDFs/Editor.pdf" runat="server"
                            style="height: 20px; width: 25px; padding-right:5px; margin-top:0px;">
               </asp:HyperLink>
            </td>
      </tr>
</div>
.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900