You haven't said what isn't working, but the HTML doesn't seem to be valid, you have a 'div' tag between your 'tr' and 'td' tags. This is valid though:
HTML Code:
<table>
<caption>
User Panel
<span style="margin-left: 65px;"><a href="#"><img src="images/open.gif"></a></span>
</caption>
<tr>
<td>
<div>
Text only visible when opened
</div>
</td>
</tr>
</table>
If it still doesn't work you should post the javascript error you're getting.