# How can I allineate sliders?

**URL:** https://discourse.nodered.org/t/how-can-i-allineate-sliders/51238
**Category:** Dashboard
**Created:** [19 September 2021 13:54 UTC](https://discourse.nodered.org/t/how-can-i-allineate-sliders/51238 "2021-09-19T13:54:23Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![GiovanniG](https://avatars.discourse-cdn.com/v4/letter/g/ecd19e/32.png) [@GiovanniG](https://discourse.nodered.org/u/GiovanniG)
#### Post date: [19 September 2021 13:54 UTC](https://discourse.nodered.org/t/how-can-i-allineate-sliders/51238/1 "2021-09-19T13:54:23Z")

</div>

Hi, I've different names which differs for lenght.. I tried to insert spaces to move the beginning of the cursor right as the logest name does, but they are ignored. I don't want to use \_\_ for example, there is any invisibel char I can use? Or any other way? Thanks

 ![immagine](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/5/7547e8e7d612800c6fad9e9ebcf585a061c743f6.png)

---

<div class="post-metadata">

### Author: ![Christian-Me](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christian-me/32/10774_2.png) [@Christian-Me](https://discourse.nodered.org/u/Christian-Me)
#### Post date: [19 September 2021 13:59 UTC](https://discourse.nodered.org/t/how-can-i-allineate-sliders/51238/2 "2021-09-19T13:59:55Z")

</div>

Only way I know and I use is place a text node as a label and use the slider without a label.

> [@Feature request: Indent value for label/widget spacing per group](https://discourse.nodered.org/t/feature-request-indent-value-for-label-widget-spacing-per-group/45786):
>
> Hello, I like to discuss a feature for the dashboard to streamline / sort the placement of labels and actual widgets inside one group. currently if you place some widgets the position of the widget is not consistent: For widgets with a label option the width of the widget is determined by the actual length of the label text. I like to suggest to add an indent parameter in the group definition do align all widgets (with a label) to one consistent vertical position. I think the indent…

As far as I know this didn’t get any further and most probably will not in the new future.  
But the solution above is ok for me.

---

<div class="post-metadata">

### Author: ![GiovanniG](https://avatars.discourse-cdn.com/v4/letter/g/ecd19e/32.png) [@GiovanniG](https://discourse.nodered.org/u/GiovanniG)
#### Post date: [19 September 2021 14:14 UTC](https://discourse.nodered.org/t/how-can-i-allineate-sliders/51238/3 "2021-09-19T14:14:16Z")

</div>

thanks, the label is a trick that can be interesting, but can I disable it to not type nothing?

It would be necessary to just find a transparent char for spaces, but seems nothing is working

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [19 September 2021 14:40 UTC](https://discourse.nodered.org/t/how-can-i-allineate-sliders/51238/4 "2021-09-19T14:40:24Z")

</div>

Leave it empty.

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [19 September 2021 14:45 UTC](https://discourse.nodered.org/t/how-can-i-allineate-sliders/51238/5 "2021-09-19T14:45:21Z")

</div>

you can use \<pre\> \</pre\> or css white-space : pre  
then just pad with space  
e.g

```auto
[{"id":"aa52642e.36932","type":"inject","z":"190c8195.72b3be","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"qwerty","payloadType":"str","x":180,"y":1040,"wires":[["e07fcc5c.4eea1"]]},{"id":"e07fcc5c.4eea1","type":"change","z":"190c8195.72b3be","name":"","rules":[{"t":"set","p":"label","pt":"msg","to":"$pad($$.payload, 20, \" \") ","tot":"jsonata"},{"t":"set","p":"payload","pt":"msg","to":"5","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":1040,"wires":[["810c61c9.ea902","33fd474a.a75a68"]]},{"id":"810c61c9.ea902","type":"debug","z":"190c8195.72b3be","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":640,"y":1040,"wires":[]},{"id":"33fd474a.a75a68","type":"ui_slider","z":"190c8195.72b3be","name":"","label":"<pre>{{msg.label}}</pre>","tooltip":"","group":"8b5cde76.edd58","order":10,"width":0,"height":0,"passthru":true,"outs":"all","topic":"topic","topicType":"msg","min":0,"max":10,"step":1,"x":590,"y":1080,"wires":[[]]},{"id":"8b5cde76.edd58","type":"ui_group","name":"","tab":"8f03e639.85956","order":1,"disp":true,"width":"12","collapse":false},{"id":"8f03e639.85956","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

```

[edit] just for info you can also use &nbsp; as the pad, no \<pre\> required  
e.g.

```auto
[{"id":"c6c7b22d.7083d8","type":"inject","z":"a3b92cc4.e3cb","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"qwerty","payloadType":"str","x":200,"y":480,"wires":[["2a85ce1f.85b472"]]},{"id":"2a85ce1f.85b472","type":"change","z":"a3b92cc4.e3cb","name":"","rules":[{"t":"set","p":"label","pt":"msg","to":"$replace($pad($$.payload, 20, \"#\"),\"#\", \"&nbsp;\")","tot":"jsonata"},{"t":"set","p":"payload","pt":"msg","to":"5","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":480,"wires":[["758a035f.10176c","3a89db4f.60ba14"]]},{"id":"758a035f.10176c","type":"debug","z":"a3b92cc4.e3cb","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":620,"y":480,"wires":[]},{"id":"3a89db4f.60ba14","type":"ui_slider","z":"a3b92cc4.e3cb","name":"","label":"{{msg.label}}","tooltip":"","group":"2d4fe667.28f8ba","order":10,"width":0,"height":0,"passthru":true,"outs":"all","topic":"topic","topicType":"msg","min":0,"max":10,"step":1,"x":610,"y":520,"wires":[[]]},{"id":"2d4fe667.28f8ba","type":"ui_group","name":"demo","tab":"1caa8458.b17814","order":1,"disp":true,"width":"12","collapse":false},{"id":"1caa8458.b17814","type":"ui_tab","name":"Demo","icon":"dashboard","disabled":false,"hidden":false}]

```

JSONata expression `$replace($pad($$.payload, 20, "#"),"#", "&nbsp;")`

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [19 September 2021 14:48 UTC](https://discourse.nodered.org/t/how-can-i-allineate-sliders/51238/6 "2021-09-19T14:48:00Z")

</div>

You can make the slider label fixed width with a template.

```auto
<style>
#TABNAME_GROUPNAME_cards .nr-dashboard-slider p.label {
   width: 70%; 
   max-width: 70%;
   min-width: 70%;
   overflow: hidden;
}
</style>

```

(change TABNAME and GROUPNAME to match your dashboard)

 ![Untitled 2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/9/8907ebc2cb771a240faf3db20034c54d892c9d3f.jpeg)

---

<div class="post-metadata">

### Author: ![GiovanniG](https://avatars.discourse-cdn.com/v4/letter/g/ecd19e/32.png) [@GiovanniG](https://discourse.nodered.org/u/GiovanniG)
#### Post date: [19 September 2021 15:00 UTC](https://discourse.nodered.org/t/how-can-i-allineate-sliders/51238/7 "2021-09-19T15:00:57Z")

</div>

thanks a lot mates all of you for the lovely support!  
I consider the template solution the coolest, it works perfectly, amazing!

---

<div class="post-metadata">

### Author: ![GiovanniG](https://avatars.discourse-cdn.com/v4/letter/g/ecd19e/32.png) [@GiovanniG](https://discourse.nodered.org/u/GiovanniG)
#### Post date: [26 September 2021 18:18 UTC](https://discourse.nodered.org/t/how-can-i-allineate-sliders/51238/9 "2021-09-26T18:18:11Z")

</div>

I post again, what happened in ths forum? I can't see more the intruments buttons, I can't edit, I can't use the code button (and I don't know what char it generates to do it manually ((

Hi, for some reasons the template is not working more, it is properly located into the group.. also in layout I don't see problems. It was working, now not more, what can happened?  
Thanks

```auto

[{"id":"4c10d1d8.76f118","type":"ui_switch","z":"cc2c1666.3d904","name":"Salotto-sw","label":"","tooltip":"","group":"6d911a9b.e39804","order":1,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"Dashboard","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"wb_incandescent","oncolor":"yellow","offvalue":"false","offvalueType":"bool","officon":"wb_incandescent","offcolor":"gray","animate":true,"className":"","x":3050,"y":760,"wires":[["5fae33a5.c4ddc4"]]},{"id":"f87e7bc3.3a347","type":"ui_slider","z":"cc2c1666.3d904","name":"","label":"Salotto","tooltip":"","group":"84144ed1.dad0a","order":1,"width":0,"height":0,"passthru":false,"outs":"end","topic":"Dashboard","topicType":"str","min":0,"max":"100","step":1,"x":3040,"y":800,"wires":[["5fae33a5.c4ddc4"]]},{"id":"8ebc0484.bee0d","type":"ui_template","z":"cc2c1666.3d904","group":"84144ed1.dad0a","name":"","order":17,"width":0,"height":0,"format":"<style>\n#Franco_1Colonna_cards.nr-dashboard-cardcontainer .nr-dashboard-slider p.label {\n width: 39%; \n max-width: 39%;\n min-width: 39%;\n overflow: hidden;\n}\n</style>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":3030,"y":700,"wires":[[]]},{"id":"6d911a9b.e39804","type":"ui_group","name":"2Colonna","tab":"ef482f31.2d1628","order":3,"disp":false,"width":"1","collapse":false},{"id":"84144ed1.dad0a","type":"ui_group","name":"1Colonna","tab":"ef482f31.2d1628","order":1,"disp":false,"width":"9","collapse":false},{"id":"ef482f31.2d1628","type":"ui_tab","name":"Pannello Domotica","icon":"dashboard","order":2,"disabled":false,"hidden":true}]

```

EDIT: I can't see buttons at all but moving with mouse the tips helped me find that

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [26 September 2021 18:35 UTC](https://discourse.nodered.org/t/how-can-i-allineate-sliders/51238/10 "2021-09-26T18:35:37Z")

</div>

Fix the Hidden option on Panello Domotica tab.

 ![Untitled 3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/f/5f59d50cbcf664da024f48c9daaa4d4dcf88239e.jpeg)

---

<div class="post-metadata">

### Author: ![GiovanniG](https://avatars.discourse-cdn.com/v4/letter/g/ecd19e/32.png) [@GiovanniG](https://discourse.nodered.org/u/GiovanniG)
#### Post date: [26 September 2021 18:54 UTC](https://discourse.nodered.org/t/how-can-i-allineate-sliders/51238/11 "2021-09-26T18:54:46Z")

</div>

I did it but nothing changed..

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [26 September 2021 20:38 UTC](https://discourse.nodered.org/t/how-can-i-allineate-sliders/51238/12 "2021-09-26T20:38:02Z")

</div>

Your template contains  
#Franco\_1Colonna\_cards.nr-dashboard-cardcontainer .nr-dashboard-slider p.label {

But your Dashboard tab and group are  
#Pannello\_Domotica\_1Colonna\_cards.nr-dashboard-cardcontainer

The styling is only applied on tab Franco

---

<div class="post-metadata">

### Author: ![GiovanniG](https://avatars.discourse-cdn.com/v4/letter/g/ecd19e/32.png) [@GiovanniG](https://discourse.nodered.org/u/GiovanniG)
#### Post date: [27 September 2021 08:13 UTC](https://discourse.nodered.org/t/how-can-i-allineate-sliders/51238/13 "2021-09-27T08:13:11Z")

</div>

You absolutely right, I had to figure out myself, sorry, big mistake from my side ( I've changed names and forgot to add new name there :((

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [11 October 2021 08:14 UTC](https://discourse.nodered.org/t/how-can-i-allineate-sliders/51238/14 "2021-10-11T08:14:00Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
