473,391 Members | 1,428 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,391 software developers and data experts.

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

Is that possible? How?

<td >
<asp:Label ID="StartDateLabel" runat="server" Text="Start Date:">
<asp:imagebutton ID="Imagebutton1" width=18 Height=18
CommandName=SetDate imageUrl="../cal.jpg" runat=server />
</asp:Label>
</td>
<td >

Oct 24 '06 #1
4 17521
On 2006-10-24, Jason <ja***@cyberpine.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="StartDateLabel" runat="server" Text="Start
Date:"></asp:Label>
<div style="float:right;vertical-align:top"/>
<asp:imagebutton ImageAlign=top ID="Imagebutton1" width=20 Height=20
CommandName=SetDate
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***@cyberpine.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.comwrote:
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="StartDateLabel" runat="server" Text="Start
Date:"></asp:Label>
<div style="float:right;vertical-align:top"/>
<asp:imagebutton ImageAlign=top ID="Imagebutton1" width=20 Height=20
CommandName=SetDate
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***@cyberpine.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.comwrote:
>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
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> ?...
14
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...
5
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
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...
1
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
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...
4
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....
6
tusovka
by: tusovka | last post by:
I have a table with 6 columns ------------------------------------------------------------- | Line | One | Two | Three | Four | Five |...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.