I have a zimlet which talks to JSP and gets an XML response. I am giving an Ajax call to jsp page. SO in the callback function i get the "result.text" as XML. I parse it to form an html and display the data in the table form within zimlet dialog box. Following is the code snippet of the callback method.

com_mycomp_vm.prototype.onDoneRetrieve= function(result){

var txt = result.text;
my_html = this.par***ML(txt);

var view = new DwtComposite(this.getShell());
var el = view.getHtmlElement();

var div = document.createElement("div");

div.innerHTML=my_html; //CONTENT OF THE DIALOG BOX
alert(div.innerHTML);
el.appendChild(div);

//ARGS OF THE DIALOG BOX
var dialog_args = {
title : "Welcome",
view : view,
standardButtons : [DwtDialog.OK_BUTTON]
};

//CREATION OF THE DIALOG BOX
var dlg = this._createDialog(dialog_args);

//TEXT DISPLAYED ON THE OK BUTTON
dlg.getButton(DwtDialog.OK_BUTTON).setText("Close" );
dlg.popup();

}

In the parse method, I parse the data and form an HTML as follows:
com_mycomp_vm.prototype.par***ML = function(txt){

....
.....
html_table = "<table class='sortable' id='anyid' cellpadding='0' cellspacing='0'><tr><th>From</th><th>Subject</th><th>Size</th><th>Date</th><th>Attachment</th></tr>";
html_table = html_table + html_row + "</table>";


my_html = my_html + "<head> <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' /><title>Sortable table example</title>";
my_html = my_html + "<link rel='stylesheet' type='text/css' href='example.css'/><link href='http://www.joostdevalk.nl/' rev='made' />";
my_html = my_html + "<script type='text/javascript' src='sortable.js'></script></head>";
my_html = my_html + "<body>" + html_table + "</body>";

return(my_html);
}

In the table tag that I have created, I am trying to apply a class='sortable' to it. This is defined in a sortable.js file which is a simple javascript file(not zimletbase) which sorts the table as you click on the columns. If I apply this code to my simple html file it sorts the table. But then in this case it deos not. Could anybody tell me how can I do it?