APL, 5
⍪⍳¨⍳⎕
creates a vector 1..n and for each element another such vector.
Then ⍪ makes a column out of all vectors. This avoids the problem with trailing blanks.
Try it on tryapl.org
Older solution:
{⎕←⍳⍵}¨⍳⎕
Creates a vector 1..n
{⎕←⍳⍵} is a function that outputs for each (¨) element a vector 1..n on a separate line
This one can't be tried on tryapl.org unfortunately, because ⎕← doesn't work there.