struggling to pivot wider

Hello,

I'm struggling with the pivot wider() function.
My data are the following :

Using the column "treatment" as the main parameter, I want to pivot wider data like this :
image
By renaming all the colums : adding the treatment as a prefix.

I've tried several expressions using pivot_wider, but I don't understand how to rename/mutate columns using the "treatment" column as a prefix.

could you help me ?
thanks in advance for your help.

Mickaël

I finally found the answer

tableau_2 <- tableau_1 |>
pivot_wider(
names_from = treatment,
values_from = c(length, volume, weight),
names_glue = "{treatment}_{.value}"
)