print()
in Python 3 prints newlines unless you tell it not to. Pass in end=''
to tell it not to print that newline:
def row_top():
print("|--|--|--|--|--|--|--|--|")
def cell_left():
print("| ", end='')
def cell_data(isQ):
if isQ:
print("X", end='')
else:
print(" ", end='')
def row(c):
row_top()
row_data(c)
print("|")