Is there a way to return the number of columns in a table?
entry.tableHandle is an array of all of the rows, and each row is an array with keys that are the column names and values that are the column values AND keys that are col1, col2, etc. and values that are the column values.

So you can do entry.tableHandle[0]|keys to get the keys, entry.tableHandle[0]|keys|length to get the number of keys, and finally (entry.tableHandle[0]|keys|length)/2 to get the number of columns.

You will want to check first that there is a row in the table - this won't work if there is no row 0.