<commit_before><h1>Sorting a table along column values</h1>

<pre style="font-family:Verdana">


Example at <a href="http://hgsweb.de/tablesort">http://hgsweb.de/tablesort</a>


The assumption is that the sort is triggered via an <b>onclick</b>-event from whithin
a header cell (TH).
Once the event is received in the <b>sortCore</b> function, we work our way up the
chain of parent nodes to find the the cellIndex of the TH-element and the table 
this TH-element belongs to.
Given this, we can access all the rows in the table body and the column cell we 
have to sort along.
The default method to access the value of the cell for comparison, is done by 
the function represented by the value of closure variable <b>getValue</b>.  
The default method for comparing values, is done by the fucntion represented 
by the value of closure variable <b>compareValues</b>.  
Both methods can be overwriten for all sort actions using the exposed functions 
<b>setGrepValue</b>, <b>setCompareValues</b>  or individualy for every column by
passing in the method as a function from outside, defined by the user.
This allows the user to write her own functions depending on the content and 
meaning of the cell values.
See example for the last column of the table, where sorting is done along the 
<b>backgroudColor</b> passing in the function <b>getColor</b> 

<commit_msg>more doc<commit_after><h1>Sorting a table along column values</h1>

<pre style="font-family:Verdana;line-height:1em">

Example at <a href="http://hgsweb.de/tablesort">http://hgsweb.de/tablesort</a>

The assumption is that the sort is triggered via an <b>onclick</b>-event from 
whithin a header cell (TH).

Once the event is received in the <b>sortCore</b> function, we work our way up the
chain of parent nodes to find the the cellIndex of the TH-element and the table 
this TH-element belongs to.

Given this, we can access all the rows in the table body and the column cell we 
have to sort along.

The default method to access the value of the cell for comparison, is done by 
the function represented by the value of closure variable <b>getValue</b>.  
The default method for comparing values, is done by the fucntion represented 
by the value of closure variable <b>compareValues</b>. 
 
Both methods can be overwriten for all sort actions using the exposed functions 
<b>setGrepValue</b>, <b>setCompareValues</b>  or individualy for every column by
passing in the method as a function from outside, defined by the user.

This allows the user to write her own functions depending on the content and 
meaning of the cell values.

See example for the last column of the table, where sorting is done along the 
<b>backgroudColor</b> passing in the function <b>getColor</b> 


{'fraction_non_alphanumeric': 0.06824817518248175, 'fraction_numerical': 0.0018248175182481751, 'mean_word_length': 4.395669291338582, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2906788', 'n_tokens_mistral': 783, 'n_tokens_neox': 765, 'n_words': 405}