title: How to pull a JSON file into an HTML table?
body: <p>I've seen a couple posts on this but I haven't been able to make anything work. I'm trying to pull the data from a JSON file into an HTML table. Each post I've tried to follow to make it work brings back nothing so I don't know if the functions are working and I'm just not pulling them in right, or if they're all just wrong. So, here's my JSON file:</p>
  
  <pre><code>    {
  "Parts": [
          {
           "CIMs":17748, 
           "Name":"Bizerba XC100 Printer", 
           "Description":"Bizerba XC100 Print Assembly",
           "Category":"Scales",
           "Location": "Shelf 1",
           "Amount": 3
           },
          {
            "CIMs":17738,
            "Name": "Bizerba XC100 Spool",
            "Description":"Bizerba XC100 Label Spool",
            "Category":"Scales",
            "Location": "Shelf 1",
            "Amount":4
            },
          {
           "CIMs":12345,
           "Name":"Lexmark MS711de",
           "Description": "Lexmark MS711de for FMC and ICC",
           "Category":"Printers",
           "Location":"Crash Site",
           "Amount":1
           },
          {
           "CIMs":23456,
           "Name":"Bill Acceptor",
           "Description":"Bill Acceptor for SCO 4.2 and 5.0",
           "Category":"SCO",
           "Location":"Shelf 2",
           "Amount":4
           },
          {
           "CIMs":34567,
           "Name": "TCU",
           "Description":"TCU for nextgen registers",
           "Category":"Registers",
           "Location":"Shelf 2",
           "Amount":2
           },
          {
           "CIMs":45678,
           "Name":"HP Desktop",
           "Description":"HP Desktop for use by everyone but managers",
           "Category":"Computers",
           "Locaton":"Shelf 2",
           "Amount":2
           },
          {
           "CIMs":56789,
           "Name":"HP DL160 HDD",
           "Description":"HP DL160 G6 160GB 2.5 inch replacement drive",
           "Category":"Servers",
           "Location":"Shelf2",
           "Amount":6
           }
      ]}
  </code></pre>
  
  <p>And here's the script I have setup:</p>
  
  <pre><code>    &lt;script&gt;
      $(function(){
  var partsList = [];
  $.getJSON('partslist.json', function(json){
      $.each(json.properties, function(i, f) {
          var tblRow = "&lt;tr&gt;" + "&lt;td&gt;" + f.CIMs + "&lt;/td&gt;" 
                  + "&lt;td&gt;" + f.Name + "&lt;/td&gt;"
                  + "&lt;td&gt;" + f.Description + "&lt;/td&gt;"
                  + "&lt;td&gt;" + f.Category + "&lt;/td&gt;"
                  + "&lt;td&gt;" + f.Location + "&lt;/td&gt;"
                  + "&lt;td&gt;" + f.Amount + "&lt;/td&gt;" + "&lt;/tr&gt;";
          $(tblRow).appendTo("#partsListData tbody");
      });
  });
      }); &lt;/script&gt;  
  </code></pre>
  
  <p>My table:</p>
  
  <pre><code>                &lt;section&gt;
              &lt;h2&gt;Parts&lt;/h2&gt;
              &lt;table id="partsListData" border="1"&gt;
                   &lt;thead&gt;
                      &lt;th&gt;CIMs&lt;/th&gt;
                      &lt;th&gt;Name&lt;/th&gt;
                      &lt;th&gt;Description&lt;/th&gt;
                      &lt;th&gt;Category&lt;/th&gt;
                      &lt;th&gt;Location&lt;/th&gt;
                      &lt;th&gt;Amount&lt;/th&gt;
                  &lt;/thead&gt;
                &lt;tbody&gt;
                 &lt;/tbody&gt;
              &lt;/table&gt;
              &lt;p&gt;&lt;a href="#" style="color: black; align-content: center;"&gt;Add Parts&lt;/a&gt;&lt;/p&gt;
              &lt;p&gt;&lt;a href="#" style="color: black; align-content: center;"&gt;List Categories&lt;/a&gt;&lt;/p&gt;
          &lt;/section&gt;
  </code></pre>
  
  <p>What am I missing?  What do I need to do in my webpage to make that pull? I've tried placing the script right under the  tag and also within the  with no luck. Help?</p>
  
  <p>EDIT: I managed to get the table to show up with the headers but the data comes back undefined. I have also updated the code in the post to what I currently have.</p>