Jump to content

Expanding table width


Jocka

Recommended Posts

all I want this to do is "slowly" expand this tables width. I've tried just about everything i could think/find. I searched many tutorials on google but none of them actually "expand' the table, they just hide it.
I tried using this code, and to ME it looks like it should work.. but it doesn't..

(ITS NOT LETTING ME POST MY JAVASCRIPT CODE SO IM THROWING SOME B/S STUFF IN THERE TO 'HIDE' IT)
[code]
<html>
<head>
<--script type="text/-javascript">
function expand(tblid) {
if (tbl = document.getElementById(tblid)) {
var i=0
for (i=0;i<=10;i++)
{
tbl.width=i
}
}
}
</--script>
</head>
<body onload="expand('test')">
<table border="1">
<tr>
<td id="test" name="test">TEST</td>
</tr>
</table>

</body>
</html>
[/code]
What am I doing wrong here?
Link to comment
Share on other sites

Yeah that was quite intresting. I tried what I said to you. And the thing is delay do not work. Perhaps that I missed something but browser does not redraw the table till the end function (at the end it's expanded by the way but I do not see that expand effect). And delays was nearly crushing my browser :)
Link to comment
Share on other sites

[quote author=Jocka link=topic=104692.msg417743#msg417743 date=1155860426]
(ITS NOT LETTING ME POST MY JAVASCRIPT CODE SO IM THROWING SOME B/S STUFF IN THERE TO 'HIDE' IT)
[/quote]

It's because of their Intrusion Prevention System (IPS). More info here: http://www.phpfreaks.com/forums/index.php/topic,104265.0.html
Link to comment
Share on other sites

Hi guys I had a go at it. I have it working, needs a bit of work. I have tried many times to post the code, but i get a page not found or something and when i did post it, the javascript was missing,  if u want it mail me and i will mail you the code, or just come visit me at my site and i will post it for u. Sorry guys, i did try my best to post it here. my site is www.cy2online.net
Link to comment
Share on other sites

[quote author=syed link=topic=104692.msg420474#msg420474 date=1156312097]
Hi guys I had a go at it. I have it working, needs a bit of work. I have tried many times to post the code, but i get a page not found or something and when i did post it, the javascript was missing,  if u want it mail me and i will mail you the code, or just come visit me at my site and i will post it for u. Sorry guys, i did try my best to post it here. my site is www.cy2online.net
[/quote]
You can post it here, but you have to edit the javascript like I did. put dashes in it like this:
[code]
<--script type="text/-javascript">

// code

</---script>
[/code]
Link to comment
Share on other sites

This is the code.

<style>

td.td1
{
font-family:tahoma;
}

</style>

<script language=javascript>

var counter=0;

function expand(){

counter = counter +10;

if (counter <= 100){
Id = window.setTimeout("expand()",15);
}


document.getElementById("td1").innerHTML = "<table border=1><tr><td valign=top height='" + counter + "'>Test</td></tr></table>";
}

</script>

<a href="#" onclick="expand()">Expand</a>

<table>
<tr>
<td id="td1" class="td1"></td>
</tr>
</table>
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.