View Full Version : Refreshing individual table cells ??

11-07-2004, 10:11 AM
I have looked around for information on this but cannot find anything, i basically want to have a table which can refresh its individual cells without reloading the whole page ?

Is this possible and if so how ??

11-07-2004, 11:51 AM
it can be done with JavaScript ^_^ Do a search for 'javascript dhtml tbody' on google and you should turn some things up -- if you can't find anything that makes sense I can post an example later on in the day. just let me know : )

11-07-2004, 02:45 PM
Thanks ill keep looking but so far most of what im finding is either making little sense or is not quite what im after
(im not so good at Javascript so forgive my ignorance)

If you could post an example that would be great, basically i have 9 cell table where i want the middle cell to refresh when you click various menu buttons in the left navigation cell.

So only the middle cell needs to update and it will basically load in new flash movies.
If you cant post the code point me in the direction of a concise tutorial as i am loathed to learn any more than i need in regards to this.
Thanks for any help in advance..


11-07-2004, 03:30 PM
well then, that should be a big problem : ) I'm not testing this quite yet, but this should work:

set up your table as such:

<td id='content'>

just make sure that the td that you want to change has an id, basically : )

then your javascript

function editTableCell(html)
var tcell = document.getElementById('content');
tcell.innerHTML = html;

I'm not sure what you want to use to change the cell, but if it were flash (for example):

var cell_html = "My dog has fleas.";

that should do it -- let me know if it works ^_^ feel free to AIM me if you have any other questions, and once we get a working solution we can post it back up here in case anybody else ever has the same question.

11-07-2004, 03:33 PM
by the way -- nice site. Doesn't come up in firefox for some reason, but I think my firefox has been acting up anyway. A little hard on the eyes, but nice and sexy ^_^

11-07-2004, 05:47 PM
Thanks for all the above !!
Its 7pm here in the UK and even i dont work this late on a sunday, so ill mess around with the script you provided tomorrow and see if i can get it working.

If i have any more probs ill be in touch, and thanks again for this, if i can get it to work ill be well happy

11-08-2004, 10:49 AM
Thanks man, much appreciated......

However is it possible that rather than updating the cell with new HTML text, that i can replace the cells contents with a FLASH movie.

I tried formatting the HTML code which is embedded to display a flash movie and putting that formatted code into thevar cell_html = "My dog has fleas.";
Like so
var cell_html = "<TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Arial\" SIZE=\"8\" COLOR=\"#000000\">&lt;object classid=&quot;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0&quot; width=&quot;80&quot; height=&quot;40&quot; id=&quot;Tabletest1&quot; align=&quot;middle&quot;&gt;&lt;param name=&quot;allowScriptAccess&quot; value=&quot;sameDomain&quot; /&gt;&lt;param name=&quot;movie&quot; value=&quot;Tabletest1.swf&quot; /&gt;&lt;param name=&quot;quality&quot; value=&quot;high&quot; /&gt;&lt;param name=&quot;bgcolor&quot; value=&quot;#ffffff&quot; /&gt;&lt;embed src=&quot;Tabletest1.swf&quot; quality=&quot;high&quot; bgcolor=&quot;#ffffff&quot; width=&quot;80&quot; height=&quot;40&quot; name=&quot;Tabletest1&quot; align=&quot;middle&quot; allowScriptAccess=&quot;sameDomain&quot; type=&quot;application/x-shockwave-flash&quot; pluginspage=&quot;http://www.macromedia.com/go/getflashplayer&quot; /&gt;&lt/object&gt;</FONT></P></TEXTFORMAT>";

However this doesnt seem to work and im not sure why...if you could figure out a way to do this itd be great if not just point me in the direction of a decent tutorial relating to it and ill try myself..

Other than that thanks as your code works great !!

11-08-2004, 03:24 PM
you'll have to reconstruct those html-entities in the javascript function. I'm not exactly a JS guru so I'm not familiar with the method for that in JS. : ) I suggest you make a template in the javascript function and just pass the .swf url into it as a variable? That way you won't have to have those huge ugly looking strings in flash : )

linguini genie
02-24-2005, 03:35 PM
I have a query very similar to this one.

I want to refresh three of the cells in a table using a button on another part of the page.

I would like to have a function where each button on the navigation menu changes the contents of a table on the page. One image and two or three hyperlinks are the contents to be changed each time.

There's no Flash involved but I'm a complete novice with Javascript, I really don't know where anything goes.

I'd really appreciate some help if anyone can spare the time.