Skip to content

Instantly share code, notes, and snippets.

@tonercart
Last active February 8, 2017 10:05
Show Gist options
  • Select an option

  • Save tonercart/3b7c9263b6f7a4245aeae63ad5c62a67 to your computer and use it in GitHub Desktop.

Select an option

Save tonercart/3b7c9263b6f7a4245aeae63ad5c62a67 to your computer and use it in GitHub Desktop.
Simple Table With Style
<template>
<h1>Static Table</h1>
<table>
<thead><tr><td>Name</td><td>Colour</td></tr></thead>
<tbody>
<tr><td>Red</td><td><div style="height: 16px; width: 16px; background-color:red;"></div></td></tr>
<tr><td>Green</td><td><div style="height: 16px; width: 16px; background-color:green;"></div></td></tr>
<tr><td>Blue</td><td><div style="height: 16px; width: 16px; background-color:blue;"></div></td></tr
</tbody>
</table>
<h1>Bound Table</h1>
<table>
<thead><tr><td>Name</td><td>Colour</td></tr></thead>
<tbody>
<tr repeat.for="row of theTable">
<td>${row.name}</td><td><div css="height: 16px; width: 16px; background-color:${row.colour};"></div></td>
</tr>
</tbody>
</table>
</template>
export class App {
title = "Test Table";
theTable = [
{name: "Red", colour: "red"},
{name: "Green", colour: "green"},
{name: "Blue", colour: "blue"},
];
}
<!doctype html>
<html>
<head>
<title>Aurelia KendoUI bridge</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.4.0/bluebird.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chroma-js/1.2.1/chroma.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2016.2.714/js/jquery.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2016.2.714/js/jszip.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2016.2.714/js/kendo.all.min.js"></script>
</head>
<body aurelia-app="main">
<h1>Loading...</h1>
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.6/system.js"></script>
<script src="https://rawgit.com/aurelia-ui-toolkits/aurelia-kendoui-bundles/1.0.0-beta.1.0.6/config2.js"></script>
<script>
System.import('aurelia-bootstrapper');
</script>
</body>
</html>
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging()
aurelia.start().then(a => a.setRoot());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment