# Grider

Grider is a plugin for jQuery that makes your life easier when you need to edit or create a table that handles a list of items. It helps you to do calculations in a very simple way, it supports the following features
• Can make simple operations defined in the headers
• Can add a row count to the table
• Adds or deletes rows based on a row
• Has summaries for average (avg), sum (sum), maximum (max) and minimum (min)
• Works nice with Ruby on rails nested forms
It has been tested with Firefox 3 and Internet Explorer 6 and Google chrome 2, you can configure many fields
```  Grider = {
defaults : {
initCalc: true, // Tells if it should do the calculations when init
addRowWithTab: true, // Allow addign rows with tab when you are focused on the delete Row
delRow: true, // Allows to delete a row
decimals: 2, // Decimals used to calculate formulas and summaries
delRowText: 'delete', // Text for deleting rows
countRow: false, // Tells to count rows
countRowCol: 0, // Tells to add the column for counting rows
countRowText: '#', // The text in the header for the count column
}
}
```
Try the example below and download this plugin grider.tgz or grider.zip

## Example 1

Product Price Quantity Discount Subtotal

Convert Table

#### Code to convert table1

# HTML in the first row where the "th" is located <tr>
<th col="product">Product</th>
<th col="price" summary="max">Price</th>
<th col="quantity" summary="avg">Quantity</th>
<th col="discount">Discount</th>
<th col="subtotal" formula="price*quantity*(1 - 0.10 * discount)" summary="sum">Subtotal</th>
</tr>
# JavaScript
# \$('#table1').grider({countRow: true, countRowAdd: true});
{"ft_lang_label":"__label__en","ft_lang_prob":0.59952265,"math_prob":0.74291193,"size":1630,"snap":"2019-13-2019-22","text_gpt3_token_len":433,"char_repetition_ratio":0.11931119,"word_repetition_ratio":0.0,"special_character_ratio":0.26871166,"punctuation_ratio":0.11551155,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.973084,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-03-19T06:34:57Z\",\"WARC-Record-ID\":\"<urn:uuid:c51cd02a-fabf-497e-8381-ff73a06845eb>\",\"Content-Length\":\"9909\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:0720424e-3f91-49b9-8577-e15f404d3a44>\",\"WARC-Concurrent-To\":\"<urn:uuid:639d8cd0-7201-44a6-a7b6-177992e303a5>\",\"WARC-IP-Address\":\"185.199.110.153\",\"WARC-Target-URI\":\"https://boriscy.github.io/grider/\",\"WARC-Payload-Digest\":\"sha1:S3VLBKXQQQNCRZUKOBRU5HPBPUSC4VGE\",\"WARC-Block-Digest\":\"sha1:J2JJ5LSIAL6BG4LNIKDM46XYFZGQ53KP\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-13/CC-MAIN-2019-13_segments_1552912201904.55_warc_CC-MAIN-20190319052517-20190319074517-00389.warc.gz\"}"}