根据给定的JSON格式数据，生成一个HTML表格。
{
    "data": [
        {
            "name": "John",
            "age": 24,
            "city": "New York"
        },
        {
            "name": "Jane",
            "age": 32,
            "city": "Los Angeles"
        },
        {
            "name": "Jim",
            "age": 18,
            "city": "Chicago"
        }
    ]
}
以下是使用JavaScript代码将JSON格式数据转换为HTML表格：

```javascript
const data = {
  "data": [
    { "name": "John", "age": 24, "city": "New York" },
    { "name": "Jane", "age": 32, "city": "Los Angeles" },
    { "name": "Jim", "age": 18, "city": "Chicago" }
  ]
};

let table = "<table>";
table += "<tr><th>Name</th><th>Age</th><th>City</th></tr>";
data.data.forEach(item => {
  table += `<tr><td>${item.name}</td><td>${item.age}</td><td>${item.city}</td></tr>`;
});
table += "</table>";

// 将生成的HTML表格放入DOM中的一个元素
document.getElementById("table-container").innerHTML = table;
```