Why the index error?


#1

File "/ports/files/table.py", line 57, in do_filter
tbl_headers(v[3]),
File "/ports/files/table.py", line 25, in tbl_headers
result = s[0][0]['c'][:]
IndexError: list index out of range

def tbl_headers(s):

    result = s[0][0]['c'][:]
    #This will began to build the columns of the table
    for i in range(1, len(s)):
        result.append(inlatex(r'} & \textbf{'))
        result.extend(s[i][0]['c'])
   #Close last column before the newline
    result.append(inlatex(r'} \\ \hline'))
    result.insert(0, inlatex(r'\textbf{'))
    return pf.Para(result)

I am using a filter to modify the size of a table that has rows, columns, & etc but can not get pass this error message. Not sure how to fix. (Although the function works when there is only 1 table being modified but if there is 2 or more tables being modified then the error message shows up.


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.