[Question]
  [
## Challenge:
Take a list, **L** containing positive integers as input:
```
3 5 2 1 6
```
and create a matrix where the n'th column contains the vector **1:L(n)**, where shorter rows are padded with zeros. 
### Test cases:
```
3   5   2   1   6
-----------------
1   1   1   1   1
2   2   2   0   2
3   3   0   0   3
0   4   0   0   4
0   5   0   0   5
0   0   0   0   6
1
-
1
1   2   3   4   3   2   1
-------------------------
1   1   1   1   1   1   1
0   2   2   2   2   2   0
0   0   3   3   3   0   0
0   0   0   4   0   0   0
```
### Rules:
* Optional input and output formats
	+ List of lists is an acceptable output format
* The matrix must be as small as possible (you may not pad it with more zeros than needed)
* Shortest code in each language wins
* Explanations are highly encouraged
  
[Answer]
# [R](https://www.r-project.org/), ~~40~~ 38 bytes
```
function(l)outer(m<-1:max(l),l,"<=")*m
```
[Try it online!](https://tio.run/##K/qfpmCj@z@tNC@5JDM/TyNHM7@0JLVII9dG19AqN7ECKKCTo6NkY6ukqZX7P00jWcNYx1THSMdQx0xT8z8A "R – Try It Online")
Explanation:
`outer` applies its third argument (the function) to all combinations of elements of its first two arguments, generating a matrix of `TRUE` and `FALSE` where each column has `TRUE` where `1:max(l)` is less than or equal to the corresponding element of `l`, for the example where `l=c(3,5,2,1,6)`:
```
      [,1]  [,2]  [,3]  [,4] [,5]
[1,]  TRUE  TRUE  TRUE  TRUE TRUE
[2,]  TRUE  TRUE  TRUE FALSE TRUE
[3,]  TRUE  TRUE FALSE FALSE TRUE
[4,] FALSE  TRUE FALSE FALSE TRUE
[5,] FALSE  TRUE FALSE FALSE TRUE
[6,] FALSE FALSE FALSE FALSE TRUE
```
Then supposing the resultant matrix is `A`, then `A*m` -> `A[i,j]=A[i,j]*i` which coerces `TRUE` to 1 and `FALSE` to 0, producing the desired result.
[Answer]
# [MATL](https://github.com/lmendo/MATL), 8 bytes
```
"@:]Xho!
```
[Try it online!](https://tio.run/##y00syfn/X8nBKjYiI1/x//9oQwUjBWMFEyA2UjCMBQA "MATL – Try It Online")
### Explanation
```
"      % Implicit input, L. For each k in L
  @    %   Push k
  :    %   Range [1 2 ... k]
]      % End
Xh     % Collect all stack contents in a cell array
o      % Convert to double matrix. The content of each cell is
       % right-padded with zeros if needed
!      % Transpose. Implicitly display
```
[Answer]
# [Python 3](https://docs.python.org/3/), 54 bytes
```
lambda x:[[-~i*(i<a)for a in x]for i in range(max(x))]
```
[Try it online!](https://tio.run/##FcYxDoMwDADAr0RMNjIDRTAgeEnI4AoClsBEgSEs/Xoqbrrw3NupTfbjlHc@vjOb1Ftb/aQEGRj9GQ0bUZPcW3kbWdcFDk6QEF0OUfSG0oNtqKUP1dQ5pGsJYzFpgfkP)
[Answer]
# Mathematica, 20 bytes
```
PadRight@Range@#&
```
Contains U+F3C7 (Mathematica's builtin `Transpose` function)
[Try it on Wolfram Sandbox](https://sandbox.open.wolframcloud.com)
### Usage
```
PadRight@Range@#&[{3, 5, 2, 1, 6}]
```
> 
> 
> ```
> {
>  {1, 1, 1, 1, 1},
>  {2, 2, 2, 0, 2},
>  {3, 3, 0, 0, 3},
>  {0, 4, 0, 0, 4},
>  {0, 5, 0, 0, 5},
>  {0, 0, 0, 0, 6}
> }
> 
> ```
> 
> 
### Explanation
```
PadRight@Range@#&
         Range@#    (* Generate {1..n} for all elements of input *)
PadRight@           (* Right-pad 0s so that all lists are equal length *)
                   (* Transpose the result *)
```
[Answer]
# [Octave](https://www.gnu.org/software/octave/), 26 bytes
```
@(x)((y=1:max(x))'<=x).*y'
```
Anonymous function that inputs a row vector and outputs a matrix.
[**Try it online!**](https://tio.run/##y08uSSxL/Z9mq6en999Bo0JTQ6PS1tAqN7ECyNZUt7Gt0NTTqlT/n6YRbaxgqmCkYKhgFqv5HwA "Octave – Try It Online")
### Explanation
Consider input `x = [3 5 2 1 6]`. This is a row vector of size 1×5.
`1:max(x)` gives the row vector `[1 2 3 4 5 6]`, which is assigned to variable `y`.
The transpose of that, i.e. the column vector `[1; 2; 3; 4; 5; 6]`, is `<=`-compared (element-wise with broadcast) with the input `[3 5 2 1 6]`. The result is the 6×5 matrix
```
[1 1 1 1 1;
 1 1 1 0 1;
 1 1 0 0 1;
 0 1 0 0 1;
 0 1 0 0 1;
 0 0 0 0 1]
```
Finally, multiplying (element-wise with broadcast) by the column vector `[1; 2; 3; 4; 5; 6]`, obtained as `y` transposed, gives the desired result:
```
[1 1 1 1 1;
 2 2 2 0 2;
 3 3 0 0 3;
 0 4 0 0 4;
 0 5 0 0 5;
 0 0 0 0 6]
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 4 bytes
```
€L0ζ
```
[Try it online!](https://tio.run/##MzBNTDJM/f//UdMaH4Nz2/7/jzbWMdUx0jHUMYsFAA "05AB1E – Try It Online") or as a [nicely formatted test suite](https://tio.run/##MzBNTDJM/V9TVvn/UdMaH4Nz2/4f2q1zeKvO/2hjHVMdIx1DHbNYrmhDIMtYxwSIgSJIfFMdMx1zHQsdy1gA)
```
€L   # For each: get the range 1..input
  0ζ # zip, padding with 0s
```
[Answer]
# [Husk](https://github.com/barbuz/Husk), 4 bytes
Returns a list of lists
```
T0mḣ
```
[Try it online!](https://tio.run/##yygtzv6vkJtb/Kip8X@IQe7DHYv///8fbaxjqmOkY6hjFgsA "Husk – Try It Online")
### Explanation
```
  m    Map over the input
   ḣ   Range from 1 to n
T0     Transpose, padding with 0s
```
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 6 bytes
```
.tSMQZ
```
**[Try it here!](https://pyth.herokuapp.com/?code=.tSMQZ&input=%5B1%2C1%2C2%2C3%2C3%2C1%2C1%2C1%5D&debug=0)** or **[Verify all the test cases (with pretty-print)!](https://pyth.herokuapp.com/?code=j.tSMQZ&input=%5B1%2C1%2C2%2C3%2C4%2C3%2C1%2C1%2C1%5D&test_suite=1&test_suite_input=%5B3%2C5%2C2%2C1%2C6%5D%0A%5B1%5D%0A%5B1%2C2%2C3%2C4%2C3%2C2%2C1%5D&debug=0)**
---
# Explanation
```
.tSMQZ   - Full program.
  SMQ    - Get the inclusive unary ranges for each.
.t       - Transpose, padding with copies of...
     Z   - ... Zero.
         - Implicit print.
```
A non-built-in transpose version [would be](https://pyth.herokuapp.com/?code=jmm%2ahd%3CdkQeS&input=%5B1%2C1%2C2%2C3%2C4%2C3%2C1%2C1%2C1%5D&test_suite=1&test_suite_input=%5B3%2C5%2C2%2C1%2C6%5D%0A%5B1%5D%0A%5B1%2C2%2C3%2C4%2C3%2C2%2C1%5D&debug=0):
```
mm*hd<dkQeS
```
This works as follows:
```
mm*hd<dkQeS   - Full program.
m        eS   - Map over [0, max(input)) with a variable d.
 m      Q     - Map over the input with a variable k.
   hd         - d + 1.
  *           - Multiplied by 1 if...
     <dk      - ... d is smaller than k, else 0.
              - Output implicitly.
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 3 bytes
```
Rz0
```
[Try it online!](https://tio.run/##y0rNyan8/z@oyuD/4Xb3//8NdYx0jHVMgNhIxxAA "Jelly – Try It Online")
## Explanation
```
Rz0  Input: array A
R    Range, vectorizes to each integer
 z0  Transpose and fill with 0
```
[Answer]
# [Actually](https://github.com/Mego/Seriously), 17 bytes
```
;M╗♂R⌠╜;0@α(+H⌡M┬
```
[Try it online!](https://tio.run/##ATkAxv9hY3R1YWxsef//O03ilZfimYJS4oyg4pWcOzBAzrEoK0jijKFN4pSs//9bMywgNSwgMiwgMSwgNl0 "Actually – Try It Online")
Explanation:
```
;M╗♂R⌠╜;0@α(+H⌡M┬
;M╗                store the maximal element (M) of the input in register 0
   ♂R              range(1, n+1) for each n in input
     ⌠╜;0@α(+H⌡M   for each range:
      ╜;0@α          push a list containing M 0s
           (+        append to range
             H       take first M elements
                ┬  transpose
```
[Answer]
# [Pyke](https://github.com/muddyfish/PYKE), 3 bytes
This uses the new feature of Pyke, hex encodings... The best part is that we tie Jelly! Raw bytes:
```
4D 53 AC
```
[Try it here!](http://pyke.catbus.co.uk/?code=4D+53+AC&input=%5B1%2C2%2C3%2C4%2C3%2C2%2C1%5D&warnings=0&hex=1)
The ASCII-Pyke equivalent would be [4 bytes](http://pyke.catbus.co.uk/?code=MS.%2C&input=%5B1%2C2%2C3%2C4%2C3%2C2%2C1%5D&warnings=0&hex=0):
```
MS.,
```
# How?
```
4D 53 AC   - Full program.
4D         - Map.
   53      - Inclusive range.
      AC   - Transpose with zeroes.
           - Output implicitly.
-------------------------------------
MS.,   - Full program.
M      - Map.
 S     - Inclusive range.
  .,   - Transpose with zeroes.
       - Output implicitly.
```
[Here](http://pyke.catbus.co.uk/?code=MS.%2CJ&input=%5B1%2C2%2C3%2C4%2C3%2C2%2C1%5D&warnings=0&hex=0) is a pretty-print version with ASCII, and [here](http://pyke.catbus.co.uk/?code=4D+53+AC+4A&input=%5B1%2C2%2C3%2C4%2C3%2C2%2C1%5D&warnings=0&hex=1) is one with hex encodings.
[Answer]
# [Perl 6](https://perl6.org), 39 bytes
```
{zip (1 X..$_).map:{|@_,|(0 xx.max-1)}}
```
[Try it](https://tio.run/##PY7NDoIwEITvPMUcjJREGusPBwmGq2/gwcQYrQkJQtOCosCTefPFcGuJh8lm55vMrpI6j4baSNwjfo692xPTc3mRSIb2lSkwgT3nk2PAbye1abv0OOvYHE1DexOKoO@Ha6mRZ4U0LPi8@aPUF0NzV1QIt0izQtUVWg@g6oOWps4rJLA3mINBTNCGfJf1Z87nin77s7KuHHQVf8ita19w/phnVNoPSwBr0oIkSJEnPDHulq3G@eNf "Perl 6 – Try It Online")
## Expanded:
```
{                # bare block lambda with implicit parameter ｢$_｣
  zip
    (1 X.. $_)   # turn each input into a Range that starts with 1
    .map:        # map each of those Ranges using the following code
    {            # bare block lambda with implicit parameter ｢@_｣ 
                 # (｢@_｣ takes precedence over ｢$_｣ when it is seen)
      |@_,       # slip the input into a new list
      |(         # slip this into the list
        0        # a ｢0｣
        xx       # list repeated by
          .max   # the max of ｢$_｣ (implicit method call)
          - 1    # minus 1 (so that zip doesn't add an extra row)
      )
    }
}
```
Note that [`zip`](https://docs.perl6.org/routine/zip.html) terminates once the shortest input list is exhausted.
[Answer]
## [C#](http://csharppad.com/gist/c8eefd5e0d7cd1078cf157bd0a2d61ab), 136 bytes
---
### Data
* **Input** `Int32[]` `i` An array of ints
* **Output** `Int32[,]` A bidimentional array.
---
### Golfed
```
i=>{int m=System.Linq.Enumerable.Max(i),l=i.Length,x,y;var o=new int[m,l];for(y=0;y<m;y++)for(x=0;x<l;)o[y,x]=i[x++]>y?y+1:0;return o;};
```
---
### Ungolfed
```
i => {
    int
        m = System.Linq.Enumerable.Max( i ),
        l = i.Length,
        x, y;
        
    var o = new int[ m, l ];
    
    for( y = 0; y < m; y++ )
        for( x = 0; x < l; )
            o[ y, x ] = i[ x++ ] > y ? y + 1 : 0;
            
    return o;
};
```
---
### Ungolfed readable
```
// Take an array of Int32
i => {
    // Store the max value of the array, the length and declare some vars to save some bytes
    int
        m = System.Linq.Enumerable.Max( i ),
        l = i.Length,
        x, y;
        
    // Create the bidimensional array to output
    var o = new int[ m, l ];
    
    // Cycle line by line...
    for( y = 0; y < m; y++ )
    
        // ... and column by column...
        for( x = 0; x < l; )
        
            // And set the value of the line in the array if it's lower than the the value at the index of the input array
            o[ y, x ] = i[ x++ ] > y ? y + 1 : 0;
            
    // Return the bidimentional array.
    return o;
};
```
---
### Full code
```
using System;
using System.Collections.Generic;
namespace TestBench {
    public class Program {
        // Methods
        static void Main( string[] args ) {
            Func<Int32[], Int32[,]> f = i => {
                int
                    m = System.Linq.Enumerable.Max( i ),
                    l = i.Length,
                    x, y;
                var o = new int[ m, l ];
                for( y = 0; y < m; y++ )
                    for( x = 0; x < l; )
                        o[ y, x ] = i[ x++ ] > y ? y + 1 : 0;
                return o;
            };
            List<Int32[]>
                testCases = new List<Int32[]>() {
                    new[] { 1, 2, 5, 6, 4 },
                    new[] { 3, 5, 2, 1, 6 },
                    new[] { 1, 2, 3, 4, 3, 2, 1 },
                };
            foreach( Int32[] testCase in testCases ) {
                Console.WriteLine( " INPUT: " );
                PrintArray( testCase );
                Console.WriteLine( "OUTPUT: " );
                PrintMatrix( f( testCase ) );
            }
            Console.ReadLine();
        }
        public static void PrintArray<TSource>( TSource[] array ) {
            PrintArray( array, o => o.ToString() );
        }
        public static void PrintArray<TSource>( TSource[] array, Func<TSource, String> valueFetcher ) {
            List<String>
                output = new List<String>();
            for( Int32 index = 0; index < array.Length; index++ ) {
                output.Add( valueFetcher( array[ index ] ) );
            }
            Console.WriteLine( $"[ {String.Join( ", ", output )} ]" );
        }
        public static void PrintMatrix<TSource>( TSource[,] array ) {
            PrintMatrix( array, o => o.ToString() );
        }
        public static void PrintMatrix<TSource>( TSource[,] array, Func<TSource, String> valueFetcher ) {
            List<String>
                output = new List<String>();
            for( Int32 xIndex = 0; xIndex < array.GetLength( 0 ); xIndex++ ) {
                List<String>
                    inner = new List<String>();
                for( Int32 yIndex = 0; yIndex < array.GetLength( 1 ); yIndex++ ) {
                    inner.Add( valueFetcher( array[ xIndex, yIndex ] ) );
                }
                output.Add( $"[ {String.Join( ", ", inner )} ]" );
            }
            Console.WriteLine( $"[\n   {String.Join( ",\n   ", output )}\n]" );
        }
    }
}
```
---
### Releases
* **v1.0** - `136 bytes` - Initial solution.
---
### Notes
* None
[Answer]
# [Perl 5](https://www.perl.org/), ~~62~~ 57 + 1 (`-a`) = 58 bytes
```
$,=$";say map$i*($_-->0),@F while++$i&&(sort{$b-$a}@F)[0]
```
[Try it online!](https://tio.run/##K0gtyjH9/19Fx1ZFybo4sVIhN7FAJVNLQyVeV9fOQFPHwU2hPCMzJ1VbWyVTTU2jOL@opFolSVclsdbBTTPaIPb/f0MFIwVjBRMgtlAw/JdfUJKZn1f8X9fXVM/A0OC/biIA "Perl 5 – Try It Online")
[Answer]
# [K (ngn/k)](https://codeberg.org/ngn/k), 17 bytes
```
{a*~x</:a:1+!|/x}
```
[Try it online!](https://ngn.codeberg.page/k#eJxLs6pO1KqrsNG3SrQy1Fas0a+o5eJKczBWMFUwUjBUMAOyDYEsYwUTIAaKAAA2CAsF)
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 142 bytes
```
i,j,k;main(c,v)char**v;{for(;++i<c;k=k<*v[i]?*v[i]:k)printf("%c ",*v[i]);for(i=48;puts(""),i++<k;)for(j=1;j<c;)printf("%c ",i<=*v[j++]?i:48);}
```
[Try it online!](https://tio.run/##VYzNCoMwEIRfpQQKiYkHfw7iJvggxYMsaDepVqL1Uvrq3aq3HmYO8/ENpgMiMxlvAowdTRLNpvDexSTZ4N0/owStySIEF2yy3ahtzq6DmiNNay/FFS/CnKOCQyBXVjC/1kUKoQxpbQOoA3iXgd@v/k2ybpe91m1DdVkp@DBzxjkXXO7JOfti/@iGhdOxyH8 "C (gcc) – Try It Online")
[Answer]
# [Proton](https://github.com/alexander-liao/proton), 38 bytes
```
a=>[[i<j?-~i:0for j:a]for i:0..max(a)]
```
[Try it online!](https://tio.run/##KyjKL8nP@59m@z/R1i46OtMmy163LtPKIC2/SCHLKjEWRAO5enq5iRUaiZqx/wuKMvNKNNRj8tT1svIz8zRyEwvAuLikSFNBW0FdQUEBIqOjkKYRbaxjqmOkY6hjFqsJBP8B "Proton – Try It Online")
[Answer]
# [Add++](https://github.com/cairdcoinheringaahing/AddPlusPlus), 37 bytes
```
D,g,@@*,bL_1+0XA$p$+bUp
L~*,€RAbM€gBc
```
[Try it online!](https://tio.run/##S0xJKSj4/99FJ13HwUFLJ8kn3lDbIMJRpUBFOym0gMunTkvnUdOaIMckXyCV7pQMVJmVn5mn41Cnw6UABMZGzllcXEDtRZkpOg4QMcPYpFAwA6ilGqS6Nu///2hjBVMFIwVDBbPYf/kFJZn5ecX/dXUzcwtyMpMzS4DM4oLU5My0SluQSQA "Add++ – Try It Online")
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 55 bytes
```
x=>f=(t=1,s,e=x.map(y=>y<t?0:s|=t))=>s?[e,...f(++t)]:[]
```
[Try it online!](https://tio.run/##ZcqxCsIwEIDh3Se5o2cwVh2ql259iZAh1FSU2hRzSAu@eww4OvzT9z/826f@dZ9lO8VryB3nhc3AIKwpUeBFPf0MK5v1Iu2uSR8WRDaptYGUUgNUlaBrrMvnTR@nFMegxniDDmxNR9qTppNDQPxjXbCmQ6lMvyV/AQ "JavaScript (Node.js) – Try It Online")
# [JavaScript (Node.js)](https://nodejs.org), 63 bytes
```
x=>[...Array(Math.max(...x,t=0))].map(_=>x.map(y=>y<t?0:t,++t))
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/Z9m@7/C1i5aT0/PsagosVLDN7EkQy83sUIDKFKhU2JroKkZC@QXaMTb2lWAGZW2dpU2JfYGViU62tolmpr/rbmS8/OK83NS9XLy0zXSNKKNdUx1jHQMdcxiNTUxJA2BUsY6JkAMVAJS8B8A "JavaScript (Node.js) – Try It Online")
[Answer]
# Java 10, 115 bytes
```
a->{int l=a.length,m=0;for(int j:a)m=j>m?j:m;var r=new int[m][l];for(;l-->0;)for(m=0;m<a[l];r[m][l]=++m);return r;}
```
**Explanation:**
[Try it online.](https://tio.run/##dVHBTsMwDL3zFT42WhttDDg0dIgPYJcdqx5Ml42UJJ1Sd2ia@u0lScsBMaRYcmy/@L2XBs@YNfvPsdbYdfCGyl7vAJQl6Q5YS9iGayyUVVlBncQMkAlfH3z40xGSqmELFgoYMdtc/RDoArmW9kgfqSmW4tC6gIUmR2aKZmNemtyIMzpwhZVfcYOpSl3FSaGzbLMULOQBbZ4xtNw0UiwWhgknqXcWnBhGMRE59e/aE5n5nFu1B@MVJTtyyh7LCtmkhmRHyc/S6rpOH9P7dJU@DVHVn/7qv7pHrdMHHx493HAkMoigyTVlTz2x344675nlwdfQm/bMXgWfIQfHYhFgd@lIGt72xE9eEGmbNP7/eE9K81fn8NJxaiexCbL5sRuomeowfgM)
```
a->{                  // Method with integer-array parameter and integer-matrix return-type
  int l=a.length,     //  Length of the array
      m=0;            //  Largest integer in the array, 0 for now
  for(int j:a)        //  Loop over the array
    m=j>m?            //   If the current item is larger than `m`:
       j              //    Set `m` to this item as new max
      :               //   Else:
       m;             //    Leave `m` the same
  var r=new int[m][l];//  Result-matrix of size `m` by `l`, filled with zeroes by default
  for(;l-->0;)        //  Loop over the columns
    for(m=0;m<a[l];   //   Inner loop over the rows
      r[m][l]=++m);   //    Set the cell at position `m,l` to `m+1`
  return r;}          //  Return the result-matrix
```
[Answer]
# [Uiua](https://uiua.org), 8 [bytes](https://codegolf.stackexchange.com/a/265917/97916)
```
+1⍉⬚¯1∵⇡
```
[Try it!](https://uiua.org/pad?src=0_2_0__ZiDihpAgKzHijYnirJrCrzHiiLXih6EKCmYgWzMgNSAyIDEgNl0KZiBbMV0KZiBbMSAyIDMgNCAzIDIgMV0K)
```
+1⍉⬚¯1∵⇡
      ∵⇡  # range of each
   ⬚¯1    # filling with -1
  ⍉       # transpose
+1        # increment
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 6 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
Would be 4 if Japt's transpose padded with `0` instead of `null`.
```
mõ zÔÕ
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=bfUgetTV&input=WzMgNSAyIDEgNl0KLVI)
[Answer]
# TI-Basic, 48 bytes
```
Ans→A
List►matr(1 or Ans,[A]
[A]
For(I,2,max(ʟA
List►matr(I(I≤ʟA),[B]
augment(Ans,[B]
End
Ansᵀ
```
Takes input in `Ans`. Similar method to [this answer](https://codegolf.stackexchange.com/a/142065/91262).
[Answer]
# [K (ngn/k)](https://codeberg.org/ngn/k), 20 bytes
```
{+(1+!'x),'&'-x-|/x}
```
[Try it online!](https://ngn.codeberg.page/k#eJxLs6rW1jDUVlSv0NRRV1PXrdCt0a+o5eJKczBWMFUwUjBUMAOyDYEsYwUTIAaKAAAxkQrR)
[Answer]
# [Scala](http://www.scala-lang.org/), 76 bytes
Golfed version. [Try it online!](https://tio.run/##PY5Ba8JAEIXv@RXvOAMh1BY9hG6gx0I9FU@Sw6i7YWXdhM00VMTfHlcR5zDMe3wM37iXIHO/O9q9Yi0@4lIUwCQBrgb9@FG331Fb0zzOV24ZZg6mCZULomsZaDINLaA9QnWSf85rIG8a78h/mok9bBgt3pirLvV/gz3QE9T@/nUGDtbhlBVIUjfW@EpJzttfTT52LdfYRK8w2Q95htxqiOQeivRRYlnivcSixIqZM3MtrvMN)
```
l=>l.flatMap(v=>(1 to l.max).map(i=>if(i<=v)i else 0)).grouped(l.max).toList
```
Ungolfed version. [Try it online!](https://tio.run/##TY9BSwMxEIXv/RXvmMASrNIeiit4FOxJPJUexjZZIkl2SaaiLfvbt0lcqqeZee/jDS8dyNE09R@f@sDYkg24LICjNjDCbfBqE@9eAu/lvN@EPdqKAl/k4PMlluAeTnn6lor7QlbfKeOItzTgUtiTRvtUDcBnuMj2TwKsgbB4bH9hmU3tksbdDIx1jqqL/WnQR@FVsmf97@O4mBv4XEdQ7NIGzzHSz@6Now1d6fIeLN8KDFllF4QRJUE8NFg1uG@wbLCWUtbIcZqu)
```
object Main {
  def f(l: List[Int]): List[List[Int]] = {
    val m = (1 to l.max).toList
    l.flatMap { value =>
      m.map { i =>
        if (i <= value) i else 0
      }
    }.grouped(m.size).toList
  }
  def main(args: Array[String]): Unit = {
    println(f(List(3, 5, 2, 1, 6)))
  }
}
```
[Answer]
# [J](https://www.jsoftware.com), 10 bytes
```
0|:>:@i."0
```
No surprises
[Attempt This Online!](https://ato.pxeger.com/run?1=m70wa8FOJT31NAVbKwV1BR0FAwUrINbVU3AO8nFbWlqSpmuxyqDGys7KIVNPyQAicFNPkys1OSNfIU3BWMFUwUjBUMEMLKCuDhM3BIoaK5gAMVAWomvBAggNAA)
```
0|:>:@i."0
      i."0   NB. create 0..n-1 range for each atom
   >:@       NB. then increment
0|:          NB. transpose
```
[Answer]
# [Nekomata](https://github.com/AlephAlpha/Nekomata), 8 bytes
```
ṀR$ᵒ{≤0I
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m70iLzU7PzexJHFZtJJurlLsgqWlJWm6Fuse7mwIUnm4dVL1o84lBp5LipOSi6FSC_ZHG-uY6hjpGOqYxXJFG4IwkGesYwLEQNFYiDIA)
Longer than other answers, because Nekomata doesn't have a padding builtin yet. I'll add one in some future version.
```
ṀR$ᵒ{≤0I
Ṁ           Maximum
 R          Range from 1 to that
  $         Swap
   ᵒ{       Make a 2D array by the following function
     ≤      If left <= right, return left
      0I    Otherwise, return 0
```
---
# [Nekomata](https://github.com/AlephAlpha/Nekomata), 8 bytes
```
R:∑0*ᵚ+Ť
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m70iLzU7PzexJHFZtJJurlLsgqWlJWm6FmuDrB51TDTQerh1lvbRJUuKk5KLoTIL9kcb65jqGOkY6pjFckUbgjCQZ6xjAsRA0ViIMgA)
```
R:∑0*ᵚ+Ť
R           Range from 1 to input
 :          Duplicate
  ∑         Sum
   0*       Multiply by 0
     ᵚ+     Add this to each element of the other array
       Ť    Transpose
```
[Answer]
# [APL (Dyalog Classic)](https://www.dyalog.com/), 5 bytes
```
⍉∘↑⍳¨
```
Anonymous tacit function.
Did you know that APL's Mix function automatically pads with zeros?
[Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v8/TeFR2wSFR72djzpmPGqb@Kh386EV//@XpBaXFINlNIwVTBWMFAwVzDQ1DIEIyDZWMAFioJgmF1idTrSBnmls2qEVYB4A "APL (Dyalog Classic) – Try It Online")
]