Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

check if cell contains a number. if it does, align to the right using the helper class

Vincent035f10842046
diff --git a/ui/component/or-table/src/index.ts b/ui/component/or-table/src/index.ts
index 2fb190702..14a23638b 100644
--- a/ui/component/or-table/src/index.ts
+++ b/ui/component/or-table/src/index.ts
@@ -113,7 +113,9 @@ export class OrTable extends LitElement {
<tbody class="mdc-data-table__content">
${this.rows.map(item => html`
<tr class="mdc-data-table__row">
- ${item.map(cell => html`<td class="mdc-data-table__cell" title="${cell}">${cell}</td>`)}
+ ${item.map((cell: string|number) => {
+ return html`<td class="mdc-data-table__cell ${classMap({"mdc-data-table__cell--numeric": typeof cell === "number"})}" title="${cell}">${cell}</td>`;
+ })}
</tr>
`)}
</tbody>