I put in this in python >>>matrix = [[0 for x in range(5)] for y in range(3)]
>>>print matrix
and the result is:
[[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]
I then, from that, want to make each of the 3 sections(rows) of [0, 0, 0, 0, 0] on a new line but remove [] and add | to the front and end and also add another line +-+-+-+-+-+ and also add the line 0 1 2 3 4 to make this:

such that >>>matrix[1][1]=1
>>>print matrix
will give: [[0, 0, 0, 0, 0], [0, 1, 0, 0, 0], [0, 0, 0, 0, 0]]
and then can be transformed into this with a function or something that is applied to matrix to give this:

print each element in for loop which is inside other loop to do the sides.Finish with bottom lines. Can you assume one number values or should you check for maximum length of numbers for the grid? If you must check, find max of len(str(numbers))) in each element and max of those.

matrix = [[0 for x in range(5)] for y in range(3)]
for sublist in matrix:
s = str(sublist)
s = s.replace('[', '|').replace(']', '|').replace(',', "")
print s
print '+-'*5 + '+'