Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<DIV> sizing/resizing 1

Status
Not open for further replies.

globularbob

Programmer
Nov 15, 2002
69
US
Hello

I have placed a <DIV> tag with some text in it inside a <TD>. Is there any way to get a <DIV> tag to resize to the dimensions of that <TD> in which it is nested upon resize of the page? My issue is that the <TD> resizes but the <DIV> stays constant causing other objects to be placed under the text.

 
Dunno if this will work. I'm unable to think, sorry :(

<TD onresize=&quot;this.childElements[0].style.width='100%';&quot;>
<DIV></DIV>
</TD>

----------
I'm willing to trade custom scripts for... [see profile]
 
If you're going to do that stormbind, why not just do this?
[tt]
<TD>
<DIV style=&quot;width: 100%&quot;></DIV>
</TD>
[/tt]

globularbob,

What are you actually trying to do with this div? If it's going to fill the whole <td>, why not apply the styles or whatever to the <td> itself and not bother with a <div>?

-- Chris Hunt
 
>> If you're going to do that stormbind, why not just do this?

>> Is there any way to get a <DIV> tag to resize to the dimensions of that <TD> in which it is nested upon resize of the page? My issue is that the <TD> resizes but the <DIV> stays constant..

My example was just an example, I don't know what size the DIV needs to be. You can use =100% or =50% or =10px, makes no difference to the example :p

----------
I'm willing to trade custom scripts for... [see profile]
 
>>What are you actually trying to do with this div? If it's >>going to fill the whole <td>, why not apply the styles or >>whatever to the <td> itself and not bother with a <div>?

I have various pictures on the page, and when I mouse over each of them, I want different text to appear in the <td> depending on the picture.

Thanks for all of your ideas, but nothing seems to work so far...
 
<td id=&quot;msgOut&quot;></td>

...

<img src=&quot;&quot; onmouseover=&quot;msg('my message')&quot;>


<script>
function msg(text){
if (document.getElementById){
document.getElementById('msgOut').innerHTML=text;
}
}
</script>

If you need compatibility with NS4 I think it can be done with more effort.

----------
I'm willing to trade custom scripts for... [see profile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top