You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to create virtual table rows with a loop, but they don't appear.
The rendering works, but only to the tbody. This is the resulting HTML.
<div>
<table>
<tbody></tbody>
</table>
</div>
The code
var h = require('virtual-dom/h');
var createElement = require('virtual-dom/create-element');
function view(state) {
function renderRows() {
var rows = []
for (var i = 0; i < state.items.length; i++) {
var item = state.items[i]
rows.push(
h('tr', [
h('td', item.documentDate),
h('td', item.documentKey)
])
)
}
return rows
}
let tableRows = renderRows()
return h('div', [
h('table', [
h('tbody', tableRows)
])
]);
}
var tree = view(state);
var rootNode = createElement(tree);
document.getElementById("app").appendChild(rootNode);
How can I get this to work?
The text was updated successfully, but these errors were encountered:
I am trying to create virtual table rows with a loop, but they don't appear.
The rendering works, but only to the
tbody
. This is the resulting HTML.The code
How can I get this to work?
The text was updated successfully, but these errors were encountered: