Displaying Table on While loops creates duplicates

Hi all,

I’m trying to display a table comparing records inside a while loop.
I have a table of all records that will be compared to: pivot
and a table of the matches to compare to the pivot: table_matches.
I want to display one table per iteration, outable = pd.concat([pivot, match], axis = 1) drawtable(outable)
then wait for user to press a button and move onto the next iteration.
The problem is, the program displays the previous table on top, and replaces the bottom table with the current iteration. Instead of having one table, I have an extra preivous table on the top.

This is my code:

while state.j <= pivots:
    pivot = table_new.loc[state.j]
    matchid = pivot['MATCH_ID']
    table_matches = prepmatches(matchid)
    matchto = count_matches(table_matches)
    st.write('MATCH_ID: ', matchid, "    Match Count: ", matchto)
    while state.k < matchto:
        match = table_matches.loc[state.k]
        outable = pd.concat([pivot, match], axis = 1)
        drawtable(outable)
        while approval == "":
            time.sleep(.5)
            state.t += 1
            st.write(state.t)
        else:
            approval = ""
            state.k += 1
            state.r += 1
    else:
        state.j += 1
        state.k = 0
        st.write(state.j)
        st.write(state.t)
        #INsert review block
        break
           
    approval=""     
else:
    st.write("Done")