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": ["john@example.com", "bob@example.com"]
};
}
});
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>john@example.com</td>
</tr>
<tr>
<td>Bob Marley</td>
<td>bob@example.com</td>
</tr>
</tbody>
</table>
</template>