Rendering an HTML table from a JSON object without using jQuery
<p>I am trying to take a JSON object output from Watson and parse it into an HTML table that can be added to a string, which is being sent as an email.
I tried using several plugins such as json2html, but could not seem to get any of them to work. </p>

<p>My JSON object looks like this: </p>

<pre><code> WATSON TONE: {
   "document_tone": {
     "tone_categories": [
       {
         "tones": [
           {
             "score": 0.15756,
             "tone_id": "anger",
             "tone_name": "Anger"
           },
           {
             "score": 0.192775,
             "tone_id": "disgust",
             "tone_name": "Disgust"
           },
           {
             "score": 0.186713,
             "tone_id": "fear",
             "tone_name": "Fear"
           },
           {
             "score": 0.255821,
             "tone_id": "joy",
             "tone_name": "Joy"
           },
           {
             "score": 0.207131,
             "tone_id": "sadness",
             "tone_name": "Sadness"
           }
         ],
         "category_id": "emotion_tone",
         "category_name": "Emotion Tone"
       },
       {
         "tones": [
           {
             "score": 0,
             "tone_id": "analytical",
             "tone_name": "Analytical"
           },
          {
             "score": 0,
             "tone_id": "confident",
             "tone_name": "Confident"
           },
           {
             "score": 0,
             "tone_id": "tentative",
             "tone_name": "Tentative"
           }
         ],
         "category_id": "writing_tone",
         "category_name": "Writing Tone"
       },
       {
         "tones": [
           {
             "score": 0.803,
             "tone_id": "openness_big5",
             "tone_name": "Openness"
           },
           {
             "score": 0.56,
             "tone_id": "conscientiousness_big5",
             "tone_name": "Conscientiousness"
           },
           {
             "score": 0.149,
             "tone_id": "extraversion_big5",
             "tone_name": "Extraversion"
           },
           {
             "score": 0.012,
             "tone_id": "agreeableness_big5",
             "tone_name": "Agreeableness"
           },
           {
             "score": 0.387,
             "tone_id": "neuroticism_big5",
             "tone_name": "Emotional Range"
           }
         ],
         "category_id": "social_tone",
         "category_name": "Social Tone"
       }
     ]
   }
 }
</code></pre>

<p>and I'm trying to append it within a string that looks like this.</p>

<pre><code>emailText = '&lt;html&gt;&lt;body&gt;&lt;h2&gt;Original Email: &lt;/h2&gt;&lt;p&gt;' + watsonInput + '&lt;/p&gt; &lt;h2&gt;Results: &lt;/h2&gt;&lt;p&gt;' + jsonOutput + ' &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;';
</code></pre>

<p>I'm a little lost here and have taken a look at several previous questions on SO, but could not figure it out based on previous answers, as many people suggest to use various jQuery Plugins.</p>

<p>Any help/suggestions are appreciated,
Thanks</p>