I haven't coded for a while and my knowledge of JavaScript is still in its early stages, so please excuse me if this question seems a bit naive.
Essentially, I've created code that filters an HTML table based on the items in the first column. The code also enables both the first column and the header to stay fixed when scrolling horizontally after the table overflows.
The issue I'm encountering is that when I search for an item and it appears, if I then scroll horizontally, the first column reverts to displaying the very first item instead of the searched item. For instance, if the first column contains A, B, C, and D in descending order, and I search for D, but upon scrolling horizontally, A is shown in the first column.
I'm a bit stuck on how to resolve this and any assistance you can provide would be highly appreciated. Thank you!
Below is the code I've written:
$(function() {
// Your JavaScript code here
});
// Function for searching and filtering the table
function myFunction() {
// Your filtering function here
}
// Your CSS code here
// Your HTML code here
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>