473,847 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Text and Image inside table <td> Alight Text Left and Image right in same cell ??

Is that possible? How?

<td >
<asp:Label ID="StartDateLa bel" runat="server" Text="Start Date:">
<asp:imagebutto n ID="Imagebutton 1" width=18 Height=18
CommandName=Set Date imageUrl="../cal.jpg" runat=server />
</asp:Label>
</td>
<td >

Oct 24 '06 #1
4 17630
On 2006-10-24, Jason <ja***@cyberpin e.comwrote:
Is that possible? How?
Set text-align: left on the cell as usual (it's likely to be the
default), and make the image float: right.

To work around a Firefox float bug, better to put the image before the
text in the source. Otherwise it will always end up on the next line.
Oct 24 '06 #2
I can't seem to get the image to align right with the a textbox to the
right of it.The datepicker image is now right justificed but the top of
the imiage is about at the middle of the textbox and label:

<td >
<asp:Label ID="StartDateLa bel" runat="server" Text="Start
Date:"></asp:Label>
<div style="float:ri ght;vertical-align:top"/>
<asp:imagebutto n ImageAlign=top ID="Imagebutton 1" width=20 Height=20
CommandName=Set Date
imageUrl="../App_Themes/WinXP_Silver/Images/datepicker.gif"
runat=server />
</div>
</td>

Also, the above is affecting the label pushing it up.

Ben C wrote:
On 2006-10-24, Jason <ja***@cyberpin e.comwrote:
Is that possible? How?

Set text-align: left on the cell as usual (it's likely to be the
default), and make the image float: right.

To work around a Firefox float bug, better to put the image before the
text in the source. Otherwise it will always end up on the next line.
Oct 24 '06 #3
On 2006-10-24, jobs <jo**@webdos.co mwrote:
I can't seem to get the image to align right with the a textbox to the
right of it.The datepicker image is now right justificed but the top of
the imiage is about at the middle of the textbox and label:
A float is vertically aligned differently from an inline replaced (e.g.
a normal img).

An inline replaced sits on the baseline. But a float has its top edge
aligned with the top of the line box.

I can think of two solutions.

1. Use a table with one row and two cells with vertical-align: baseline.
Put the text in the first cell and the image in the second.
2. A bit more unusual, set text-direction: rtl on the container, and
text-direction: ltr on the asp:Label, and leave the image as an
inline replaced (i.e. don't float it).
<td >
<asp:Label ID="StartDateLa bel" runat="server" Text="Start
Date:"></asp:Label>
<div style="float:ri ght;vertical-align:top"/>
<asp:imagebutto n ImageAlign=top ID="Imagebutton 1" width=20 Height=20
CommandName=Set Date
imageUrl="../App_Themes/WinXP_Silver/Images/datepicker.gif"
runat=server />
</div>
</td>

Also, the above is affecting the label pushing it up.

Ben C wrote:
>On 2006-10-24, Jason <ja***@cyberpin e.comwrote:
Is that possible? How?

Set text-align: left on the cell as usual (it's likely to be the
default), and make the image float: right.

To work around a Firefox float bug, better to put the image before the
text in the source. Otherwise it will always end up on the next line.
Oct 24 '06 #4
On 2006-10-24, Ben C <sp******@spam. eggswrote:
On 2006-10-24, jobs <jo**@webdos.co mwrote:
>I can't seem to get the image to align right with the a textbox to the
right of it.The datepicker image is now right justificed but the top of
the imiage is about at the middle of the textbox and label:

A float is vertically aligned differently from an inline replaced (e.g.
a normal img).

An inline replaced sits on the baseline. But a float has its top edge
aligned with the top of the line box.

I can think of two solutions.

1. Use a table with one row and two cells with vertical-align: baseline.
Put the text in the first cell and the image in the second.
I should have added then set text-align: left on the first cell and
text-align: right on the second one.
2. A bit more unusual, set text-direction: rtl on the container, and
text-direction: ltr on the asp:Label, and leave the image as an
inline replaced (i.e. don't float it).
Actually there's very little to be gained by messing about with
text-direction, so I'd say forget that.
Oct 24 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3585
by: A Web Master | last post by:
As a mean of not having to use Framesets/Frames with all the bad side effects/workarounds that come with them, I want to know if it is possible to code a scrolling veritcal bar into a table <TD> ? If so, how ? I am coding my client's WEB site in ASP.
14
21941
by: Zenobia | last post by:
Hello folks, Is it possible to position an item within a <td> element? For instance see below. The table has multiple rows, one for each database record. Each row has 3 hrefs associated with it (for edit, delete and update). I want to position these 3 href items in the same columns, which would be posible if the span could be positioned - for instance on the extreme right of the td in which it is contained.
5
4466
by: Steel | last post by:
Hi at all, I have a table into my css file I wrote: td{vertical-align:top;} But I want that a certain image be at the bottom of my <td> How can I do please? Regards Steel
4
4074
by: dropdeadster | last post by:
Trying to line up a tic-tac-toe board type grid of images using style= tags to <img inside a table TD but it's not working, I get more like a set of steps, can I get an explanation of what's wrong with this and how to do it correctly?: <table border="1"> <tr> <td valign="top" align="left">
1
16101
nirmalsingh
by: nirmalsingh | last post by:
how to place controls inside table? i wrote code like <td align=left valign=middle class=formleftheading><inptut type=text value= " + hai" ></td> but it does'nt works
1
2442
by: munnaj | last post by:
hai all, Help me with a style code for firefox. Below is the code which is working fine in IE. But does not work well in firefox. I have also tried with another class for firefox that too not working. Do help me..... <td width='75%' align='left' valign='top' style='width:700px;word-wrap:break-word'><p align='justify'>$Description</p></td>"
4
4134
by: Nathan Sokalski | last post by:
I have a <tdthat contains several elements, some of which are left-aligned, right-aligned, or centered. I do not know the widths of these elements beforehand, so I cannot give my <tda fixed width. I want the <td> to have as small a width as possible without causing anything to wrap, but IE seems to want to make it bigger. Does anybody know of a good way to prevent a <tdfrom being stretched to a larger width than necessary? Thanks. --...
6
8012
tusovka
by: tusovka | last post by:
I have a table with 6 columns ------------------------------------------------------------- | Line | One | Two | Three | Four | Five | ------------------------------------------------------------- | 1 | a | Two | Three | Four | Five | ------------------------------------------------------------- | 2 | b | Two | Three | Four | Five |...
0
9730
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10983
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
7882
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7056
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5719
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5911
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4528
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4119
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3164
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.