# Side by side sliders

In this question Manipulate with a variable number of sliders one of the answer is

DynamicModule[{n = 5, data = Table[RandomReal[], {20}]},
Column[{Slider[Dynamic[n], {1, 20, 1}],
Dynamic[Grid[
Table[With[{i = i}, {Slider[Dynamic[data[[i]]]],
Dynamic[data[[i]]]}], {i, n}]]]}]]


Unfortunately the sliders are developped up to down and I wonder if there is a way to develop them side by side or positionned in a matrix.

Here is the normal behavior

---s---

---s1---

---s2---

---s3---

which after expansion will give

---s---
---s1---

---s2---

---s3---

---s4---

---s5---
. . .

I want --- because it takes less space

---s---
---s1--- ---s3---

---s2--- ---s4---

---s5--- .

   .            .

.            .

.            .


and why not with 3 or more columns

• Have you tried to play with Column/Grid used there? – Kuba Aug 24 '17 at 7:51
• Yes without success – cyrille.piatecki Aug 24 '17 at 8:36

## Answer to the question after editing

You can use Multicolumn to automatically format elements of a list arranged in a grid of many columns.

DynamicModule[
{
n = 5,
data = Table[RandomReal[], {20}]
},
Column[
{
Slider[Dynamic[n], {1, 20, 1}],
Dynamic[
Multicolumn[
Table[
With[{i = i},
Column[{Slider[Dynamic[data[[i]]]], Dynamic[data[[i]]]}]], {i,
n}]
, 3]
]
}
]
]


## Answer to the question before editing

Change Column for Row. Transpose the table.

DynamicModule[
{
n = 5
, data = Table[RandomReal[], {20}]
},
Row[
{
Slider[Dynamic[n], {1, 20, 1}],
Dynamic[
Grid[Transpose@Table[
With[{i = i}, {Slider[Dynamic[data[[i]]]], Dynamic[data[[i]]]}]
, {i, n}]
]
]
}
]
]

• I have edited the question. Hope to have been clearer – cyrille.piatecki Aug 24 '17 at 8:55
• @cyrille.piatecki, doe this answer the new question? In the future, please explain what you need in the question in detail from the beginning. If you then realize you need something different, ask another question. Read here. Now, let's do a clean up of the obsolete comments. – rhermans Aug 24 '17 at 9:05