473,411 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

How to use the relative positioning for labels and textboxes?

Hi,

I am finding difficulty in placing a label which should be relative to a table. If I modify the positioning to absolute then it is being placed in a different position which looks awkward during the run time. I want the label to be adjacent to the Table how can I do that.

- Naga
Jun 22 '07 #1
3 2552
nateraaaa
663 Expert 512MB
Hi,

I am finding difficulty in placing a label which should be relative to a table. If I modify the positioning to absolute then it is being placed in a different position which looks awkward during the run time. I want the label to be adjacent to the Table how can I do that.

- Naga
Sounds like you need to create a table within a table and then use a <td> tag to place your label where you want it.

Expand|Select|Wrap|Line Numbers
  1. <table>
  2.  <tr>
  3.     <td>
  4.        <table><tr><td>Your original table here</td></tr></table>
  5.     </td>
  6.     <td>Your label here. You could add some <br> tags to move this text down a bit.</td>
  7.  </tr>
  8. </table>
Hope this helps

Nathan
Jun 22 '07 #2
Frinavale
9,735 Expert Mod 8TB
Is this really a .NET question? Or is it an HTML question?

You can create a CSS class for positioning your label if you'd like, then just set the labels CssClass property. Maybe use the css property float:left for the label?

So your css will look something like:
Expand|Select|Wrap|Line Numbers
  1. <style type="text/css">
  2.     .labelStyle
  3.     {
  4.         float:left;
  5.     }
  6. </style>
  7.  
Your HTML will look something like:
Expand|Select|Wrap|Line Numbers
  1. <table>
  2.   <tr><td>...</td></tr>
  3. </table>
  4. <asp:label id="Lbl_mylabel" runat="server" CssClass="labelStyle"></asp:label>
  5.  
By setting an element's float, you indicate to the browser that the rest of the website's content should be displayed on one side of that element. In this case your table will be displayed on the Left Of Your Label.

Cheers,


-Frinny
Jun 22 '07 #3
nateraaaa
663 Expert 512MB
Is this really a .NET question? Or is it an HTML question?

You can create a CSS class for positioning your label if you'd like, then just set the labels CssClass property. Maybe use the css property float:left for the label?

So your css will look something like:
Expand|Select|Wrap|Line Numbers
  1. <style type="text/css">
  2.     .labelStyle
  3.     {
  4.         float:left;
  5.     }
  6. </style>
  7.  
Your HTML will look something like:
Expand|Select|Wrap|Line Numbers
  1. <table>
  2.   <tr><td>...</td></tr>
  3. </table>
  4. <asp:label id="Lbl_mylabel" runat="server" CssClass="labelStyle"></asp:label>
  5.  
By setting an element's float, you indicate to the browser that the rest of the website's content should be displayed on one side of that element. In this case your table will be displayed on the Left Of Your Label.

Cheers,


-Frinny
Great tip Frinny. You are definitely better using css than I am. I will keep this in mind.

Nathan
Jun 22 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Ken Kast | last post by:
Here's my situation. I have a statically positioned table that has an image in a cell. I also have some layers, defined by absolute-positioned DIVs for some animation. Everything works until I...
2
by: Stephen Weatherly | last post by:
Could anyone please help me with a problem I am having with my table widths??? If I have 2 images within a td tag, but using CSS relative positioning I position one over the top of the second (I...
2
by: Catherine Lynn Wood | last post by:
I need to know how to overlap DIV content within 'relative' associated rendering. I am building div layers in the middle of a page and when I set positioning to absolute in the CSS, it references...
3
by: Markus Ernst | last post by:
Hello Reading the follwing document: http://www.w3.org/TR/WD-positioning-970131#In-flow it seems very clear that position:relative should be relative to the parent element. So in the following...
5
by: Sergey Poberezovskiy | last post by:
Hi, Can anyone tell me how do I position controls within Netscape without using tables? Consider the following: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD>...
2
by: Rob R. Ainscough | last post by:
I'm slowly (very slowly) working my way thru the bizarre and sadistic world of control positioning in MultiViews (ASP 2.0). I came across this to help me explain (or attempt to anyway) why my web...
7
by: GaryDean | last post by:
In my old 1.1 apps the default was MS_POSITIONING="GridLayout" and Textboxes and labels and such always had POSITION: absolute; and I never had any distortion when the page was rendered. Life was...
3
by: mikewse | last post by:
I have a strange problem where it seems IE is doing the correct layout but Firefox and Safari isn't. I think I'm probably wrong, and there is something in the standards that say behaviour should be...
7
by: Cruelemort | last post by:
All, I have a div in my page that has a set width of 1000px, height of 200px, inside this i declare two more div's, both relatively positioned and floated left, the first is placed to the top...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.