I needed the same thing except with the ability to ignore columns, override values, and not be confused by nested tables. I ended up writing a jQuery plugin table-to-json:
https://github.com/lightswitch05/table-to-json
All you have to do is select your table using jQuery and call the plugin:
var table = $('#example-table').tableToJSON();
Here is a demo of it in action:
http://jsfiddle.net/nyg4z/27/