473,406 Members | 2,549 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,406 software developers and data experts.

problem lining up elements in a <td>..

hi,

I can't get all elements inside a <tdto valign to middle (default)
when include an input type-text.. pls see example here..
http://www.mayacove.com/css/table.html
(there is a slight difference depending on whether input field is done
with css or not, but essentially problem remains the same for both cases..)

what is problem please... you can see that both text input and imgs
line up perfectly well when they're on their own...;) (as shown in
bottom two examples..) why can't they line up ok when all together (I
left img-borders on so can better see what I mean..)

thank you...

Oct 10 '06 #1
1 1554
On 2006-10-10, maya <ma********@yahoo.comwrote:
hi,

I can't get all elements inside a <tdto valign to middle (default)
when include an input type-text.. pls see example here..
http://www.mayacove.com/css/table.html
(there is a slight difference depending on whether input field is done
with css or not, but essentially problem remains the same for both cases..)

what is problem please... you can see that both text input and imgs
line up perfectly well when they're on their own...;) (as shown in
bottom two examples..) why can't they line up ok when all together (I
left img-borders on so can better see what I mean..)
You've got a single table cell containing three inline elements, which
are baseline-aligned with each other. The whole lot is middle-aligned
within the table cell.

If you add a bit of text in your source before the <input>, and then
also type something into the input on the displayed page, you will see
how the inline boxes are baseline-aligned.

It looks bad because the inputs have a certain amount of space in them
below the baseline. But that's desirable or you wouldn't see the
descenders on glyphs like g-- in other words letters than hang below the
baseline would be clipped.

But if the bottom edge of the inputs were aligned with the baseline, any
text in them would be out-of-line with the buttons. This would be
incorrect, and would look equally bad.

So that's why they don't line up. There is a good reason.

One approach might be to put SEARCH, the input and GO in separate table
cells, and set vertical-align: bottom on the cells. Then they will be
aligned at the bottom (but text in the inputs will of course be above
the row baseline).
Oct 10 '06 #2

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

Similar topics

0
by: Matt Adams | last post by:
I want to move the following <PRE> defintion to a css file: <TABLE><TR><TD><PRE>sample text</PRE></TD> <TD> not predefined font</TD></TR></TABLE> should be <TABLE><TR><TD class=aaa>sample...
2
by: js | last post by:
I have a table rendered with XSLT. The first column has a radio button controls for user to make a selection for a particular row. All the values in the remaining columns are all concated with a...
2
by: bissatch | last post by:
Hi, I am trying to use JavaScript to write a table column on a web page. The code is as follows: <html> <head> <script> function displaycount() {
3
by: RC | last post by:
I have a very sime html table like <html><head><title>My Table</title> <style> input { margin: 0; padding: 0; border-width: 0; text-indet: 0; text-align: left } </style></head><body> <table...
3
by: Henry Johnson | last post by:
Okay - I'm spinning my wheels on this one... can someone help me figure out how to programmatically populate a table cell as follows (from C# code-behind)? I've tried using a Literal control in the...
2
by: petereffect | last post by:
i have foll. code <tr> <a href="a1.shtml"> <td width='100%'> &nbsp;"+Testing+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td> </a>
5
by: mahesr | last post by:
I want to match some particular text between <tr>and </tr> or <td>and </td>.... in PHP. like below............ <table><tr> CATEGORY: <td><font face="Verdana" size="1" color="#A000A0"> Wedding...
4
George Lft
by: George Lft | last post by:
I'm new at building table. Mostly PHP programming . Now I can't seem to fix the size of my table row and column. Any idea? <h4>Two rows and three columns:</h4> <table border="1"> <tr> ...
4
by: harryusa | last post by:
I am trying to center 2 images concentrically which are z-indexed to lay on top of each other making an image with a border from another image that has a transparent center. I need the images to be...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
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...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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...

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.