Table cell formatting
Something has puzzled me for a long time, and I can't seem to figure out how to fix this situation. As I explain this, it may dawn on you that there's a better way to accomplish what I'm trying to do, and if so, I'm definitely open to suggestion.
Let's say that I have a that I've set to 500 pixels wide. And then let's say inside that at the top of it, I have four elements that I need to display across it from left to right. The left-most element needs to display from the left edge of it, and the right-most element needs to display from the right edge of it. The easiest way that I've come up with to display those elements in a row across that is to put them inside cells in a table, which has a WIDTH attribute of "100%", which makes the table the same width as the , but also stretches out the cells within the table to fit that width as well.
Now, Let's say I want an image to display immediately to the right of the text (variable width text....it's always something different) that is displayed in the left-most element. If I try to display the image (a very small image mind you....an icon, 11x11 pixels) immediately after the text, it doesn't quite look right, because the bottom edge of the image sits slightly higher than the bottom edge of the text for some reason. So, the only way that I can apparently get it to display on the same level from the bottom as the text does, is to put it in a second table cell right next to it, and set that cells VALIGN parameter to "bottom". Now, that works...partially. It does display the image at the same level as the text, but the problem is, there's now a large gep between the end of the text, and the image in that next cell, because of the way that the browser has automatically sized the table width, and thus the table cell width. What I need to know (and what I've so far been grossly unsuccessful in finding a solution for) is if there is a way that I can specify the width of that first table cell to be variable width, so that there is no white space either before or after the text that is displayed in it? And even ultimately, is there a way to give that same cell a flexible, yet maximum width property??
Any ideas would be greatly appreciated. Thanks in advance.
::YEX::
<)))><
John 16:32-33
Busy posted this at 03:48 — 7th January 2003.
He has: 6,151 posts
Joined: May 2001
do you want to do it with 's or tables?
best to use one or the other.
I'd suggest the (css) method
Renegade posted this at 08:32 — 7th January 2003.
He has: 3,022 posts
Joined: Oct 2002
.right-float {
float:right;
}
.left-float {
float:left;
}
This will float left
This will float right
enjoy
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.