# EXAMPLE (template) - displaying a one dimensional table

**URL:** <https://discourse.nodered.org/t/example-template-displaying-a-one-dimensional-table/659>\
**Category:** Dashboard\
**Created:** [7 June 2018 10:55 UTC](https://discourse.nodered.org/t/example-template-displaying-a-one-dimensional-table/659 "2018-06-07T10:55:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [7 June 2018 10:55 UTC](https://discourse.nodered.org/t/example-template-displaying-a-one-dimensional-table/659/1 "2018-06-07T10:55:39Z")

</div>

Problem: You need to display a table of temperatures.

Sample data (temperatures): 67.4, 69.5, 72.5, 67.8, 65.0

We will use a function node to create the table like this:  
 ![20%20AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/bfa2ee18289ec82da13b2985e6dfc81cf1d71219.png)

And display the table using the template node. Here is what we use in the template node:  
 ![02%20AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/5b5fbca13ef5ee14d7dab3a1b51f0d38ef00b80f.png)  
Notice that the TR element has a ng-repeat option that is the key to displaying all rows of the table.

Here is what the display will look like:  
 ![27%20AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/83c8e44187fec14b0f85f9e7fdd46e54422d657a.png)

the following is the flow that is used in this example:  
`[{"id":"ca42b7eb.b7725","type":"inject","z":"968ca76f.3dc46","name":"Go","topic":"","payload":"1","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"","x":90,"y":160,"wires":[["34ad1933.dbe566"]]},{"id":"34ad1933.dbe566","type":"function","z":"968ca76f.3dc46","name":"build array (1)","func":"var arr =[67.4, 69.5, 72.5, 67.8, 65.0];\nmsg.payload = arr;\nreturn msg;","outputs":1,"noerr":0,"x":260,"y":160,"wires":[["d4f28744.a9fa"]]},{"id":"d4f28744.a9fa","type":"ui_template","z":"968ca76f.3dc46","group":"b8630066.5d446","name":"One dimension array table (temperature)","order":1,"width":"6","height":"6","format":"<table id=\"table\" border=\"1\">\n <tr>\n <th>Temperature</th> \n </tr>\n <tbody>\n <tr ng-repeat=\"row in msg.payload\">\n <td class=\"numeric\" >{{row}}</td>\n </tr>\n </tbody>\n</table>\n","storeOutMessages":false,"fwdInMessages":false,"templateScope":"local","x":520,"y":160,"wires":[["100f3061.79b17"]]},{"id":"100f3061.79b17","type":"debug","z":"968ca76f.3dc46","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":790,"y":160,"wires":[]},{"id":"b8630066.5d446","type":"ui_group","z":"","name":"One dimension Array","tab":"f9ac9e91.20e588","order":1,"disp":true,"width":"6","collapse":false},{"id":"f9ac9e91.20e588","type":"ui_tab","z":"","name":"Table Examples","icon":"dashboard","order":1}]`
