Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 89135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:40:09+00:00 2026-05-10T22:40:09+00:00

I learned that by trying to use the tablesorter plug in from jquery the

  • 0

I learned that by trying to use the tablesorter plug in from jquery the table needs to use the < thead> and
< tbody> tags. I am using an html table, and I use the runat=’server’ attribute because I need to bind data to the table on the server side. but by using the runat= server attribute the code is rendered in a different way..instead of the view source looking like this which is what is in my markup view :

<table id='Table'>     <thead>         <tr> <th>1st</th> <th>2nd</th> <th>3rd</th> </tr>     </thead>     <tbody>         <tr><td>1st value</td><td>2nd value</td><td>3rd value</td></tr>         <tr><td>1st value</td><td>2nd value</td><td>3rd value< /td></tr>         <tr><td>1st value</td><td>2nd value</td><td>3rd value</td></tr>         <tr><td>1st value</td><td>2nd value</td><td>3rd value</td></tr>     </tbody> </table> 

it looks like that but without the < thead> and < tbody> tags.. which will make the table sorter not work? can someone help me fix this? ‘ .NET 3.5 sp1 is the version I am using’

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T22:40:09+00:00Added an answer on May 10, 2026 at 10:40 pm

    You should take a look here –Code Project Sortable Gridview using JQuery Tablesorter

    Essentially, you need to use the UseAccessibleHeader property of the Gridview so that a thead tag is outputted in the HTML output.

    protected void Page_Load(object sender, EventArgs e) {  if (this.gridView.Rows.Count > 0) { gridView.UseAccessibleHeader = true; gridView.HeaderRow.TableSection = TableRowSection.TableHeader; gridView.FooterRow.TableSection = TableRowSection.TableFooter; } } 

    if using a html table with the runat=’server’ attribute instead of asp.net server controls, it looks as though there isn’t an easy way to prevent the thead tags from not rendering in the html output. You could use some JQuery to insert thead tags into the DOM on document ready-

        //in script tags after JQuery and JQuery tablesorter src declarations     $(function()      {         $('#test').prepend(         $('<thead></thead>').append($('#test tr:first').remove())          );          $('#test').tablesorter();             //your table options     });   //your html and asp markup <table id='test' runat='server'> <thead><tr><th>1</th><th>2</th><th>3</th></tr></thead> <tbody>   <tr><td>my data 1.1</td><td>this data 1.2</td><td>that data 1.3</td></tr> <tr><td>this data 2.1</td><td>that data 2.2</td><td>my data 2.3</td></tr> <tr><td>that data 3.1</td><td>my data 3.2</td><td>this data 3.3</td></tr> </tbody> </table>  

    outputs this, which works correctly with tablesorter-

    <table id='test'> <thead> <tr> <th class='header'>1</th> <th class='header'>2</th> <th class='header headerSortDown'>3</th> </tr> </thead> <tbody> <tr> <td>this data 1.1</td> <td>that data 1.2</td> <td>my data 1.3</td> </tr> <tr> <td>my data 2.1</td> <td>this data 2.2</td> <td>that data 2.3</td> </tr> <tr> <td>that data 3.1</td> <td>my data 3.2</td> <td>this data 3.3</td> </tr> </tbody> </table> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Since I use jQuery 1.3+ all except one timed test is using that. The
I learned that when executing commands in Python, I should use subprocess. What I'm
I'm new to shell,I just learned that use (command) will create a new subshell
I'm trying to use fetchAll on a query that has 2 variables. I can't
I'm trying to use file_get_contents() to get the response from a server and this
I am new to PL/SQL, I'm trying to execute the commands that I learned
I am trying to use examples that are fun/interesting to me in order to
What are the applications for your personal use that needs a small database like
I've recently learned that i shouldn't store html encoded data in the database, but
I've learned the hard way that regexes cannot adequately parse html, prior to finding

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.