/*! jQuery JSON to Table - v1.1.2 - 2014-04-07
* https://github.com/jongha/jquery-jsontotable
* Copyright (c) 2014 Jong-Ha Ahn; Licensed MIT */
!function(a){a.jsontotable=function(b,c){var d=a.extend({id:null,header:!0,className:null},c);c=a.extend(d,c);var e=b;if("string"==typeof e&&(e=a.parseJSON(e)),c.id&&e.length){var f,g,h=a("<table></table>");for(c.className&&h.addClass(c.className),a.fn.appendTr=function(b,c){var d,e,f,h,i,j=c?"thead":"tbody",k=c?"th":"td";if(a.isPlainObject(b)&&b._data){g="<tr";for(d in b)"_data"!==d&&(g+=" "+d+'="'+b[d]+'"');g+="></tr>",b=b._data}else g="<tr></tr>";g=a(g);for(e in b)if(f=b[e],"function"!=typeof f){if(h="",a.isPlainObject(f)&&f._data){h="<"+k;for(i in f)"_data"!==i&&(h+=" "+i+'="'+f[i]+'"');f=f._data,h+=">"+f+"</"+k+">"}else h="<"+k+">"+f+"</"+k+">";g.append(h)}if(c)a(this).append(a("<"+j+"></"+j+">").append(g));else{var l=a(this).find("tbody");0===l.length&&(l=a(this).append("<tbody></tbody>")),l.append(g)}return this},c.header&&h.appendTr(e[0],!0),f=c.header?1:0;f<e.length;f++)h.appendTr(e[f],!1,f);a(c.id).append(h)}return this}}(jQuery);