Header=[] # not including first collumn if column is specified
Col=[]
curRow=0
colWidth=0
tRow=""
def tInit(h,w,c=[]):
   global Header, Col, curRow,colWidth
   colWidth = w
   if len(c) == 0:
      Col = []
      for i in range(50):
         Col.append("")
   else:
      Col = c
   row = Col[0]
   for el in h:
      row += cPad(el)
   print(row)
   curRow = 1
   tRow = ""
   
   


def cPad(s):
   global colWidth
   w = len(s)
   ret=""
   lft = int((colWidth-w)/2)   
   for i in range(lft):
      ret += " "
   ret += s
   while len(ret)<colWidth:
      ret += " "
   return ret

def Pad(s):
   global colWidth
   ret = s
   while len(ret)<colWidth:
      ret += " "
   return ret 
   
def tPrint():
   global tRow,curRow,Col   
   print(Col[curRow]+tRow)
   curRow += 1
   tRow = ""


def tRowColElement(v):
   global tRow
   tRow += Pad(v)
   

      
