html table with data from it. The problem is that i want the table to be sorted for a certain column and since the table is built up row by row from the dict i was expecting to have the first element of my dict to be the first row of my html table. Instead, the order is not kept while building up the html table. Any idea ? Is this possible to achieve this or i need to sort the html table directly in js?
an ordereddict maintains the order based on what order you insert elements in
The dict is sorted using orderedDict
ordereddict is not a sorted dict
I created the orderedDict and i sorted it
sorted_dict = OrderedDict(sorted(unsorted_dict.items(), key=lambda x: x[1]["key_of_my_dict"],reverse=True))
why use a dict there
Обсуждают сегодня