JavaScript prototype which accepts a JSON array of objects and returns an HTML table