oTree Forum >

How to reverse history table?

#1 by Aroneo

Hi, everyone! I set history table in my result page using below codes. However, the table tells recent rounds' information at the botttom. I really want to put recent information on the top of the table, i.e. to reverse the sequence of rows. Is there any ways to do that? Thank you so much!

Codes:
def vars_for_template(player: Player):
    return dict(me_in_all_rounds=player.in_all_rounds())

<table class="table">
    <tr>
        <th>Round</th>
        <th>Number</th>
    </tr>
    {{ for p in me_in_all_rounds }}
    <tr>
        <td>{{ p.round_number }}</td>
        <td>{{ p.number }}</td>
    </tr>
    {{ endfor }}
</table>

Write a reply

Set forum username