Here it is a sample flow. Inject to populate the table, then refresh the page and the table will collapse.
[{"id":"f76226824f0b9691","type":"inject","z":"1c508b727f857010","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"aspiratore_camera\":{\"status\":\"Online\",\"state\":0,\"name\":\"Aspiratore stanzino\",\"teleperiod\":60,\"fw\":\"11.1.0(sensors)\",\"uptime\":\"1T01:12:08\",\"ip\":\"192.168.1.63\",\"ssid\":\"Vodafone-saltydog\",\"signal\":60},\"deumidificatore\":{\"status\":\"Online\",\"state\":0,\"name\":\"Deumidificatore\",\"teleperiod\":10,\"fw\":\"11.1.0(sensors)\",\"uptime\":\"1T06:25:55\",\"ip\":\"192.168.1.64\",\"ssid\":\"Vodafone-saltydog\",\"signal\":64},\"contact-1\":{\"status\":\"Online\",\"state\":0,\"name\":\"Contatto porta\",\"teleperiod\":10,\"fw\":\"11.1.0(lite)\",\"uptime\":\"1T01:12:49\",\"ip\":\"192.168.1.66\",\"ssid\":\"Vodafone-saltydog\",\"signal\":54},\"irr-laterali\":{\"status\":\"Online\",\"state\":0,\"name\":\"Irrigatori laterali\",\"teleperiod\":60,\"fw\":\"11.1.0(tasmota)\",\"uptime\":\"1T01:15:02\",\"ip\":\"192.168.1.61\",\"ssid\":\"Saltydog_1ext\",\"signal\":74},\"irr-centrale\":{\"status\":\"Online\",\"state\":0,\"name\":\"Irrigatore centrale\",\"teleperiod\":60,\"fw\":\"11.1.0(tasmota)\",\"uptime\":\"1T01:14:41\",\"ip\":\"192.168.1.60\",\"ssid\":\"Saltydog_1ext\",\"signal\":76},\"ventilatore\":{\"status\":\"Online\",\"state\":0,\"name\":\"Ventilatore\",\"teleperiod\":10,\"fw\":\"11.1.0(tasmota)\",\"uptime\":\"0T01:14:32\",\"ip\":\"192.168.1.62\",\"ssid\":\"Saltydog_1ext\",\"signal\":78},\"cancello\":{\"status\":\"Online\",\"state\":0,\"name\":\"Apricancello\",\"teleperiod\":10,\"fw\":\"11.1.0(tasmota)\",\"uptime\":\"1T01:13:18\",\"ip\":\"192.168.1.67\",\"ssid\":\"Saltydog_1ext\",\"signal\":90},\"pala-soffitto\":{\"status\":\"Online\",\"state\":0,\"name\":\"Pala soffitto\",\"teleperiod\":5,\"fw\":\"11.1.0(sensors)\",\"uptime\":\"1T01:16:30\",\"ip\":\"192.168.1.68\",\"ssid\":\"Saltydog_1ext\",\"signal\":100},\"ac-salone\":{\"status\":\"Online\",\"state\":0,\"name\":\"AC Salone\",\"teleperiod\":10,\"fw\":\"11.1.0(ir)\",\"uptime\":\"1T01:14:12\",\"ip\":\"192.168.1.57\",\"ssid\":\"Saltydog_1ext\",\"signal\":100},\"striscialedsalone\":{\"status\":\"Online\",\"state\":0,\"name\":\"Striscia Led Salone\",\"teleperiod\":10,\"fw\":\"11.1.0(tasmota)\",\"uptime\":\"1T01:11:47\",\"ip\":\"192.168.1.51\",\"ssid\":\"Saltydog_1ext\",\"signal\":100},\"PAB-plug\":{\"status\":\"Online\",\"state\":0,\"name\":\"PAB-plug\",\"teleperiod\":60,\"fw\":\"11.1.0(tasmota)\",\"uptime\":\"3T22:47:48\",\"ip\":\"192.168.1.70\",\"ssid\":\"Saltydog_1ext\",\"signal\":100},\"luxmetro\":{\"status\":\"Online\",\"state\":0,\"name\":\"Luxmetro\",\"teleperiod\":1,\"fw\":\"11.1.0(sensors)\",\"uptime\":\"1T01:17:24\",\"ip\":\"192.168.1.71\",\"ssid\":\"Vodafone-saltydog\",\"signal\":70},\"monitoraf\":{\"name\":\"Monitor Antifurto\",\"ip\":\"192.168.1.65\",\"signal\":96,\"ssid\":\"Saltydog_1ext\",\"status\":\"Online\"}}","payloadType":"json","x":310,"y":660,"wires":[["cb0f021ed039bdba"]]},{"id":"cb0f021ed039bdba","type":"ui_template","z":"1c508b727f857010","group":"3176bcdb2f85e1cd","name":"custom table","order":6,"width":0,"height":0,"format":"\n<style>\n#devices {\n font-family: Arial, Helvetica, sans-serif;\n border-collapse: collapse;\n width: 100%;\n\n}\n\n#devices td, #devices th {\n border: 1px solid #ddd;\n padding: 8px;\n}\n\n\n#devices tr:nth-child(even){background-color: #f2f2f2;}\n\n#devices tr:hover {background-color: #ddd;}\n\n#devices th {\n padding-top: 12px;\n padding-bottom: 12px;\n text-align: left;\n background-color: #04AA6D;\n color: white;\n}\n\n.green {color:#04AA6D;}\n.red {color:red;}\n</style>\n\n\n<table id=\"devices\">\n <tr style=\"font-size:smaller\">\n <th>Device Name</th>\n <th>MQTT topic</th>\n <th>IP Address</th>\n <th>WiFi AP</th>\n <th>Strength</th>\n <th>Telemetry</th>\n <th>Firmware</th>\n <th>Uptime</th>\n <th>Status</th>\n <th>Web UI</th>\n </tr>\n <tr ng-repeat=\"(k,v) in msg.payload\" \n style=\"font-size:smaller; border:1px dotted\">\n <td><b>{{v.name}}</b></td>\n <td>{{k}}</td>\n <td>{{v.ip}}</td>\n <td>{{v.ssid}}</td>\n <td>{{v.signal}}%</td>\n <td>{{v.teleperiod}} min.</td>\n <td>{{v.fw}}</td>\n <td>{{v.uptime}}</td>\n <td ng-class=\"{green: v.status=='Online', red: v.status=='Offline'}\">{{v.status}}</td>\n <td><a href=\"http://{{v.ip}}\" target=\"_blank\"><i class=\"fa fa-external-link\" aria-hidden=\"true\"></i></a></td>\n </tr>\n</table>\n","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":true,"templateScope":"local","className":"","x":530,"y":660,"wires":[[]]},{"id":"3176bcdb2f85e1cd","type":"ui_group","name":"test","tab":"8baef7542f2ef651","order":2,"disp":true,"width":"20","collapse":false,"className":""},{"id":"8baef7542f2ef651","type":"ui_tab","name":"Dispositivi","icon":"dashboard","disabled":false,"hidden":false}]