Hi There! New poster here. I have searched the forums for an answer to my question, but I haven't found anything. Forgive me if the question has an obvious answer or is in general too noobish.
I am using a jQuery javascript app to make a regular table into a table that has a scrollbar on the right side and can be scrolled.
The script I mean is here:
The purpose is that users can scroll the contents of the table and still see the headers, so that they don't have to remember which column is what.
To do this, the scrollbartable app extracts the first header of the table and puts it aside:
However, the table I am using has two tr's in the header:
So as you see the fifth column has a name "Analyses", and it is subdivided into an arbitrary amount of other colums (as many as there are analyses).
The Scrollbartable app only puts the first <tr> in the header. All the names of the analyses of teh second <tr> are put in the table itself and scroll away when the table is scrolled.
How can I modify the javascript in a simple way so that it also takes the second <tr> and puts in in a non-scrollable header?
Thanks in advance for your answers!
I am using a jQuery javascript app to make a regular table into a table that has a scrollbar on the right side and can be scrolled.
The script I mean is here:
The purpose is that users can scroll the contents of the table and still see the headers, so that they don't have to remember which column is what.
To do this, the scrollbartable app extracts the first header of the table and puts it aside:
Code:
/* Remove the header and put it before the rest of the table as a new table*/
var $firstRow = $t.clone();
$firstRow.find('tr:not(:first)').remove();
$t.find('tr:first').remove();
$t.before($firstRow);
However, the table I am using has two tr's in the header:
Code:
<table class="rspace scrollbarTableLarge">
<thead>
<tr>
<th rowspan="2">1</th>
<th rowspan="2">2</th>
<th rowspan="2">3</th>
<th rowspan="2">4</th>
<th colspan="{$project->getPlannedAnalyses()|@count}">Analyses</th>
<th rowspan="2">6</th>
</tr>
<tr>
{foreach from=$project->getPlannedAnalyses() item=analyse}
<th>{$analyse->naam}</th>
{/foreach}
</tr>
</thead>
<tbody>
.....
</tbody>
So as you see the fifth column has a name "Analyses", and it is subdivided into an arbitrary amount of other colums (as many as there are analyses).
The Scrollbartable app only puts the first <tr> in the header. All the names of the analyses of teh second <tr> are put in the table itself and scroll away when the table is scrolled.
How can I modify the javascript in a simple way so that it also takes the second <tr> and puts in in a non-scrollable header?
Thanks in advance for your answers!