Hello,
I use the TableSort plug-in with a large table (many columns and rows) that cannot appear all at once on smaller screens. In connection with creating a responsive site, I would like to 'fix' the header row and the leftmost column so that they remain on screen when scrolling down or right.
I have been researching the various possibilities for fixing the header row and left column but have not, so far, been able to locate a solution that I am sure will work together with TableSort and retain the functionalities of the latter.
Does anyone have experience with this and can recommend a solution?
Regards,
mjhdavies
TableSort - fixed header row and fixed leftmost column?
Moderator: Tata
Re: TableSort - fixed header row and fixed leftmost column?
Hello mjhdavies,
for this purpose the best solution is a jQuery-Plugin, such as: TableHeadFixer
Demo: Fix table head and left column
for this purpose the best solution is a jQuery-Plugin, such as: TableHeadFixer
Demo: Fix table head and left column
„Bevor du den Pfeil der Wahrheit abschießt, tauche die Spitze in Honig!“ Ludwig's XH-Templates for MultiPage & OnePage
Re: TableSort - fixed header row and fixed leftmost column?
Hello Ludwig,
Vielen Dank!
I will try to hit it out (although I have no previous experience of jQuery). I hope it is compatible with the TableSort plug-in.
Regards,
mjhdavies
Vielen Dank!
I will try to hit it out (although I have no previous experience of jQuery). I hope it is compatible with the TableSort plug-in.
Regards,
mjhdavies
Re: TableSort - fixed header row and fixed leftmost column?
it should be possible.mjhdavies wrote:I hope it is compatible with the TableSort plug-in.
- Download from GitHub tableHeadFixer.js and README.md
- store this files in ./templates/YOURTEMPLATE/js/
- open template.htm e.g. in Notepad++
- add at the end, before </body> -Tag
Code: Select all
<!-- tableHeadFixer.js - script by lai32290 https://github.com/lai32290/TableHeadFixer -->
<script type="text/javascript" src="<?php echo $pth['folder']['template']?>js/tableHeadFixer.js"></script>
<script>
$(document).ready(function() {
$(".sortable").tableHeadFixer({"left" : 1});
});
</script>
CMSimple: under Settings > CMS
CMSimple_XH: Plugins > jQuery > Config
- Edit your sortable table and add a <div> around table e.g.:
Code: Select all
<div class="fixedheadertable">
<table class="sortable zebra design1">
<thead>
...
</table>
</div>
Code: Select all
.fixedheadertable {
max-height: 800px;
max-width: 500px;
/* overflow: auto; */ /* EDIT: Not necessary, generated by the plugin! */
}
Last edited by lck on Fri Jan 08, 2016 9:00 am, edited 1 time in total.
„Bevor du den Pfeil der Wahrheit abschießt, tauche die Spitze in Honig!“ Ludwig's XH-Templates for MultiPage & OnePage
Re: TableSort - fixed header row and fixed leftmost column?
Hi again Ludwig,
Thank you for your very detailed instructions re. Fixed Table Header.
Yes, it is Gert's Table Sort plug-in which I am using (without any modifications) in a site made with CMSimple_XH where it works fine.
Thank you for your very detailed instructions re. Fixed Table Header.
Yes, it is Gert's Table Sort plug-in which I am using (without any modifications) in a site made with CMSimple_XH where it works fine.