Ruby, 33 bytes ->n,m{[*(0...n*m).each_slice(m)]} Try it online!
posted 2y ago by south
# [Ruby](https://www.ruby-lang.org/en/), 33 bytes ``` ->n,m{[*(0...n*m).each_slice(m)]} ``` [Try it online!](https://tio.run/##KypNqvz/P03BVkHXLk8ntzpaS8NAT08vTytXUy81MTkjvjgnMzlVI1cztparQEErLdpIxzhWB8Qw1TGL/f8fAA)