Create your HTML tables from objects in Blaze!
Install using Meteor's package management system:
> meteor add gbit:maketable
> meteor test-packages ./
You can use the MakeTable from a helper
Just do it:
Template.myTemplate.helpers({
elements: function(){
return {
"Names": ["John Doe", "Bob Marley"],
"Emails": ["[email protected]", "[email protected]"]
};
}
});
Results:
<template name="myTemplate">
<table class="my-class">
<thead>
<tr>
<th>Names</th>
<th>Emails</th>
</tr>
</thead>
<tbody>
<tr>
<td>John Doe</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Bob Marley</td>
<td>[email protected]</td>
</tr>
</tbody>
</table>
</template>