##QBIC, 41 bytes
QBIC, 41 bytes
:~a>0|[a|?@|`+space$(b-1)+@\`][a+1|Z=Z+@- Explanation
:~a>0| Gets a, and checks if a > 0 If it isn't the program quits without printing anything [a| For b=1; b <= a; b++ ?@|`+ Print "|" space$ and a number of spaces (b-1) euqal to our current 1-based line - 1 +@\` and a "\" ] NEXT [a+1| FOR c=1; c <= a+1; c++ Z=Z+@- Add a dash to Z$ Z$ gets printed implicitly at the end of the program, if it holds anything The last string literal, IF and second FOR loop are closed implicitly.