Hi,

I've implemented this code onto a clients website which basically allows a block of text or anything wrapped within the [expand] tags become a cropped version depending on where the user inserts the [split] tag.

Basically something like:

Code:
[expand]Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam accumsan. Sed tristique. In vel dui at erat hendrerit commodo. Aenean libero. [split]Phasellus ac erat. Pellentesque aliquam, arcu ut bibendum feugiat, nisl est tristique nulla, non eleifend ligula felis nec neque. Fusce elementum ornare felis. Cras a nunc at velit euismod volutpat. Etiam pulvinar. Vestibulum mattis suscipit nisl. Cras tincidunt tempus arcu. Suspendisse aliquam. Pellentesque cursus ullamcorper ipsum. [/expand]
Would look like this on screen:

Code:
 
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam accumsan. Sed tristique. In vel dui at erat hendrerit commodo. Aenean libero....(more)
But when I try and insert a HTML table inside the expand tags specifically after the split, it naturally gets displayed on the web where it should become hidden.

Any ideas?

Javascript code:

Code:
function show_paragraph(link,id) {
 menu = document.getElementById(id);
 if(menu.style.display == "inline"){
  menu.style.display = "none";
  link.innerHTML = "(More)";
 link.title = "Show paragraph";
 } else {
  menu.style.display = "inline";
  link.innerHTML = "(Hide)";
 link.title = "Hide paragraph";
 }
} //end function show_comment()
Presentation code:

Code:
$x=0;
   while(substr_count($t,"[EXPAND]")>0){
    $text = get_text($t,"[EXPAND]","[/EXPAND]");
    if(substr_count($text['contents'],"[SPLIT]") > 0){
     $parts = explode("[SPLIT]",$text['contents']);
     $tit = $parts[0];
     $tit.= "<span style=\"display:none;\" id=\"".$x."\">".$parts[1]."</span>";
     $tit.= "<a href=\"#\" onclick=\"show_paragraph(this,'".$x."');return false;\" title=\"Show paragraph\" class=\"textShowHide\">(More)</a>";
    }
    $t = $text['before'].$tit.$text['after'];
    $x++;
   } //end while
CSS Code:

Code:
 
.textShowHide{
 font-size: smaller;
    position: relative;
    top: -0.4em;
}
I'm baffled!!!!!!!!!