Forum Moderators: open

Message Too Old, No Replies

Newbie : layout within a table cell

         

cp_north

7:58 pm on Apr 25, 2003 (gmt 0)

10+ Year Member



I know this is probably a really annoying question, and I'm not even sure if its strictly CSS, but I've been playing around trying to figure it and getting nowhere.

My basic question is, how can you get a group of elements to take "as much space as is avaialble to them" within a table cell.

i.e. I have a TEXTAREA and an IMG sharing a cell. What I'd like to do is set the image's width so that it never stretches, but then get the text area to use up the rest of the table width.

i.e. currently I have :

<TD><TEXTAREA... width=420px><IMG... width=20px><\TD>

(The table is set to have a column width of 440px)
But I want the table column width to be able to expand to, say 600px, and I don't want to have to recalculate all the content's width.

If I Try
<TD><TEXTAREA... width=100%><IMG... width=20px><\TD>

Then the IMG is pushed down yo the next line.

If I Try :

<TD><TEXTAREA... ><IMG... width=20px><\TD>

Then the TextArea seems to have some default width of about 16 characters.

With other elements, such as text or even dropdownlists, they seem to take up the space that's left to them. How can I get TextArea to do the same?

Any help appreciated.

scottmack

1:20 am on Apr 26, 2003 (gmt 0)

10+ Year Member



Textareas and IMGs are inline elements - they can be on the same line together unless they forced to wrap by what is containing them. Like words of text. The 100% width is forcing the image down.
Try putting the textarea in a TD and the image in a second TD column and play around with that