Methods
(inner) wrapInTable(target) → {string}
Wrap object array into HTML table body tr+td's
Parameters:
| Name | Type | Description |
|---|---|---|
target |
Array.<Object> | array of objects |
- Source:
Returns:
Stringed HTML table body tr+td's
- Type
- string
Example
const data = [
{id: 1, name: "John"},
{id: 2, name: "Marry"},
];
const responseHTML = wrapInTable(data);
// responseHTML =
// <tr>
// <td>1</td>
// <td>John</td>
// </tr>
// <tr>
// <td>2</td>
// <td>Marry</td>
// </tr>