Issues with the TableSort plugin in asp.net

Let's get started: I have a basic table in an ASP page

         <table id="provasort" class="tablesorter">
            <thead>
                <tr>
                    <th>head1</th>
                    <th>heade2</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>body1</td>
                    <td>body2</td>
                </tr>
                <tr>
                    <td>body3</td>
                    <td>body4</td>
                </tr>
            </tbody>

        </table>

I've included a link to the CSS file and the jQuery tablesort plugin in the site.master:

       <link href="content/style.css"          rel="stylesheet" type="text/css" />

       <script type="text/javascript" src="Scripts/jquery-1.10.2.js"></script>
       <script type="text/javascript" src="Scripts/jquery.tablesorter.js"></script>

This is the CSS file I downloaded from the official plugin site:

    table.tablesorter {
   font-size: 12px;
   background-color: #4D4D4D;
   width: 1024px;
   border: 1px solid #000;
    }

    table.tablesorter th {
  text-align: left;
  padding: 5px;
  background-color: #6E6E6E;
    }

    table.tablesorter td {
  color: #FFF;
  padding: 5px;
    }

   table.tablesorter .even {
  background-color: #3D3D3D;
   }

   table.tablesorter .odd {
 background-color: #6E6E6E;
   }

   table.tablesorter .header {
 background-image: url('../Images/bg.png');
 background-repeat: no-repeat;
 border-left: 1px solid #FFF;
 border-right: 1px solid #000;
 border-top: 1px solid #FFF;
 padding-left: 30px;
 padding-top: 8px;
 height: auto;

   }

   table.tablesorter .headerSortUp {
 background-image: url('../Images/asc.png');
 background-repeat: no-repeat;
   }

   table.tablesorter .headerSortDown {
 background-image: url('../Images/desc.png');
 background-repeat: no-repeat;
   }

The plugin is called like this:

$('#provasort').tablesorter()

Here are the issues I'm facing:

1) The plugin doesn't seem to sort my table. Clicking on the column headers doesn't do anything, and there are no errors in the console.

2) The CSS appears to be working except for the background-image in the header.

Thank you

Answer №1

give this a shot...

<table id="provasort" class="tablesorter">
            <thead>
                <tr>
                    <th><a>header1</a></th>
                    <th><a>header2</a></th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>data1</td>
                    <td>data2</td>
                </tr>
                <tr>
                    <td>data3</td>
                    <td>data4</td>
                </tr>
            </tbody>

        </table>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

After my jQuery functions are executed, my CSS rules are loaded

Struggling with the communication between CSS and jQuery, I find myself torn. In CSS, my rules are often very specific, like this: div#container > div#contentLeft { //Code here } However, when I add jQuery to spice up my site, the CSS rules seem to ...

Using AJAX will only send numeric values, not alphabetical characters

I am currently working on a single-page application where I use ajax to set ColdFusion session variables. Within the application, I have two buttons: one is called the "New Button" and the other is the "Print Labels Button." Both buttons are designed to po ...

Menu not functioning properly on iPhone?

I recently completed a web page that features a fixed menu at the top of the page. Strangely, while the menu works perfectly fine on the Android mobile version, it doesn't seem to function properly on an iPhone. Can anyone shed some light on why this ...

Facing a delay issue during the ASP.NET application_start event. What could possibly be causing this slow performance?

void Application_Start(object sender, EventArgs e) { Thread thread = new Thread(new ThreadStart(createIndex)); thread.Start(); } void createIndex() { string constring = "server=localhost;port=3306;database=hr;uid=root;passwor ...

What steps do I need to take in order to create functions that are

I have 10 functions with similar structures: function socialMedia_ajax(media){ return ajaxRequest('search/' + media + 'id', media + 'id').then( function(res) { var imgStatus = res[1].length > 0 ? "c ...

Tips for bringing in and adding an excel spreadsheet to a kendo grid with the help of JQuery

I am facing a challenge with my kendo grid as I am trying to incorporate an excel file into it. Specifically, I would like to import and add an excel file to my kendo grid. If, for instance, my kendo grid initially has 3 rows, after importing an excel file ...

Using Jquery for a synchronous "Ajax" request doesn't seem to be functioning

As a newcomer to javascript, I am currently in the process of developing a react/flux app and utilizing jquery for synchronous "ajax" calls (sjax?) to the backend. However, I am encountering inconsistent behavior which seems to be caused by my ajax call no ...

Having trouble making alerts or confirmation dialogs function in JavaScript

EDIT: Many thanks to everyone who helped fix this issue (: Your help is greatly appreciated! I've been struggling to get the alert, confirm, or prompt functions to work properly in my code. Here's a snippet of the code that's causing troubl ...

I am currently facing challenges retrieving data from a post request in my Angular/Typescript frontend application connected to an ASP.NET backend

I am currently working on a web application that relies on backend processing. To communicate between my Angular(v14)/Typescript front end and an ASP.NET backend, I am sending a post request. Backend Code [HttpPost] public async Task<string> Process ...

Customize CSS for Vimeo's HTML5 player

Can I customize Vimeo's HTML and CSS attributes? I have a video that autoplays and I don't want the play button. I want to modify this specific class. .a.l .b .as { position: absolute; top: 50%; left: 50%; margin: -2em 0 0 -3.25em; float: none; ...

The accumulation of .ajaxComplete continues to grow

Something interesting has come to my attention. I implemented ajax in a carousel structure to dynamically add more items when needed, and it appears to be functioning correctly. Here is the ajax call located within a function named ItemLoad(): $.ajax({ ...

Form submitted using ajax did not receive a success confirmation

I have been working on creating a contact form for WordPress using ajax, but I am encountering an issue with the success function in jQuery not appending the confirmation message. PHP Function add_action('wp_ajax_submit_form', 'submit_form ...

A guide on implementing arrow links in D3.js

i am struggling to add an arrow to one end of a link in my code. even though the links are functioning correctly, i can't seem to figure out how to draw arrows successfully. any assistance on how to implement this would be greatly appreciated. thank y ...

Create a line with elements that end on the next line without taking up the full width

In a row of three links, I want the third one to be on the next line, but using .new-line { display:block; } makes the link 100% width on the next line, causing the entire area to be clickable. I also have content in the :before that should appear inline w ...

Submitting a form without uploading a file in Spring MVC: A step-by-step guide

When working with a form that includes input text fields and an input file field for database entries, I encountered an issue when creating a second form to edit the same entry. The data was retrieved from the database and filled into the new form, mirrori ...

Event listener is failing to execute the functions

Even though the inline onmouseover="verdadero()" function is properly set up Upon further inspection, it appears that while the event listener is added to the box element, the function is not being triggered when hovering over it, and console.lo ...

Submitting a PDF document to the server with PHP Laravel through AJAX

Struggling to send a PDF file via AJAX to my server for handling by a PHP script in a Laravel project. The file doesn't seem to be making it to the server. Despite receiving a 200 response in the network, the server is returning 'file not presen ...

What is the most effective method to convert PHP data into JSON and present it in the jQuery success scenario?

In the realm of jQuery, I have this particular piece of code: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script> <script type="text/javascript" > $(function() { $("input[type ...

Looking to place the bootstrap menu icon on the right side of the page

I have a bootstrap menu item on my website and I want to move the menu icon to the right corner of the page. How can I modify the code to achieve this? #menu { position: relative; color: #999; width: 200px; padding: 10px; margin: auto; font-fa ...

Stop users from being able to select or highlight text within a content editable div

Is there a method to develop a content-editable div where users are unable to select or highlight content, but can still input information? I'm interested in creating an interface that forces users to delete and enter data character by character, with ...