I am trying to sort and make an html table from a python list (list comes from database):
[('222', 'Workroom', '111'),
('333', 'Setup Part', '222'),
('444', 'Scale', '222'),
('666', 'Workroom', ''),
('888', 'Setup Part', '777'),
('777', 'Workroom', '666'),
('555', 'Workroom', '111'),
('111', 'Workroom', '')]
based on their hierarchy. The first item in each tuple represents its ID, the second one represents a description and the third represents its "parent". How could I make a program that organizes it in a hierarchical form in an html table?
this is what I mean by hierarchical form and an example of what I would like to do with the data