Skip to content

Latest commit

 

History

History
62 lines (54 loc) · 991 Bytes

README.md

File metadata and controls

62 lines (54 loc) · 991 Bytes

MakeTable

Create your HTML tables from objects in Blaze!

Installation

Install using Meteor's package management system:

> meteor add gbit:maketable

Testing (if you clone the package)

> meteor test-packages ./

How to use

Using the blaze helper

You can use the MakeTable from a helper

Just do it:

	<template name="myTemplate">
		{{ makeTable elements tableClass="my-class" }}
	</template>
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>