omkarkhair/jsonTable — pull request #6 by Dam-Buty (2013-11-08 06:10:24+00:00)
Title: Reworked the handling of the source table

Hi,

As trollboy pointed out, jsonTable could only work with a table that already exists in the DOM. That is to say, a table created via $("

") for example, could not be jsonTableified.

This came from the handling of the source table, which depended heavily on the selector of the initial "this".

I submit this update that stores the initial "this" in the settings, and uses this reference to add the headers, rows and cells. I have tested it to work with a table from the DOM, and a table created by jQuery.
I also changed the function so that any table can be used, even without a thead and a tbody. Any preexisting theads and tbodies would be erased though.
I'm pretty sure i also made jsonTableUpdate chainable :)

You can see all this in action on this fiddle : http://jsfiddle.net/KcTuv/5/

I changed the readme accordingly, and also documented the neat '*' auto-increment option.

Cheers!
D