kippie
Technical User
- Nov 8, 2001
- 158
In the HTML below I have a function which places different texts in the cell 'textframe'. Now I would like to make it so that if the text is too big for the cell, a scrollbar appears in the table cell, while the table cell itself should keep the original set dimension. I thought the code below should work but it doesn't. What do I do wrong?
This is the HTML:
<html>
<head>
<script language="JavaScript"><!--
//This is the function to change text on a changing background:
function htmlChange(id,message,bg){
d=document;
re=d.all?d.all[id]:d.getElementById(id);
re.style.padding = "80px"
re.innerHTML=message;
re.style.background = "url("+bg+"
";
}
var msg1 = 'This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1'
var msg2 = 'And this is text2'
// -->
</script>
</head>
<body>
<table border="1" bordercolor="red" width="500" height="325" cellpadding="0" cellspacing="0" style="table-layout: fixed; width: 500; height:325; overflow: auto;">
<tr height="25">
<td id="headmenu" colspan="2" height="25"><a href="#" onclick="htmlChange('textframe',msg1,'bgWhite.gif');">Link1</a> <a href="#" onclick="htmlChange('textframe',msg2,'bgMidnightBlue.gif')">Link2</a></td>
</tr>
<tr height="300">
<td id="textframe" bgcolor="#4169e1" width="384" height="300">This is the text in the textframe</td>
</tr>
</table>
</body>
</html>
Kippie
This is the HTML:
<html>
<head>
<script language="JavaScript"><!--
//This is the function to change text on a changing background:
function htmlChange(id,message,bg){
d=document;
re=d.all?d.all[id]:d.getElementById(id);
re.style.padding = "80px"
re.innerHTML=message;
re.style.background = "url("+bg+"
}
var msg1 = 'This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1'
var msg2 = 'And this is text2'
// -->
</script>
</head>
<body>
<table border="1" bordercolor="red" width="500" height="325" cellpadding="0" cellspacing="0" style="table-layout: fixed; width: 500; height:325; overflow: auto;">
<tr height="25">
<td id="headmenu" colspan="2" height="25"><a href="#" onclick="htmlChange('textframe',msg1,'bgWhite.gif');">Link1</a> <a href="#" onclick="htmlChange('textframe',msg2,'bgMidnightBlue.gif')">Link2</a></td>
</tr>
<tr height="300">
<td id="textframe" bgcolor="#4169e1" width="384" height="300">This is the text in the textframe</td>
</tr>
</table>
</body>
</html>
Kippie