1

I am generating a dynamic HTML table string and displaying inside a div. I am assigning ID and runat server in that string. eg.

string s="<table id='tblAll' runat='server'></table>".

This string is generated on some different page, and its passed as XmlhttpResponseText

I want to apply sorting on this table, It would be great if any one can help me out. Thanks

2 Answers 2

4

You can use jQuery tablesorter plugin

Sign up to request clarification or add additional context in comments.

2 Comments

ya but how?? i can not assign the id, as its in string $("#HTMLTableName").tablesorter(); its not able to find that HTML Table ID
After inserting the object to the DOM you can bind it. I am not sure whether tablesorter will work for dynamically generated objects.
0

Use the jQuery tablesorter plugin, and instead of selecting the table via it's Id, you can select it via the containing div and a child selector:

$("div#container table").tablesorter();

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.