on-internet
← Community

Best way to sort table based on headers using Flask

Stack Overflow ·

I have my table that gets generated based on what's in the database and would like to add the ability to sort the table based on particular columns. I tried looking online but since the table isn't static, I'm not sure how to properly add in the ability to sort. <table class="table" style="border: 3px solid black;"> <thead> <tr> <th style="border-left: 1px solid #eee;" class="align-middle">Select</th> <th class="align-middle">Col1</th> <th class="align-middle">Col2</th> <th class="align-middle">Col3</th> <th class="align-middle">Col4</th> </tr> </thead> <tbody> {% for row in data %} <tr> <td><

Comments

Sign in or sign up to comment and upvote.

No comments yet.