In views formatted as table, columns with taxonomy term fields are sorted according to term ID, not label In Drupal 8 I have View formatted as table, where user can click to any column header to sort displayed records according to the given field. This works well for numbers (ascending/descending), as well as for plain text (ascending/descending for title or any other text values), records are then sorted correctly alphabetically. But this does not work for taxonomy terms - they are sorted according to taxonomy term ID and not alphabetically according to label.

I.e. I wish to display in the table column with a taxonomy term (only one value is allowed per node) and be able to sort the table alphabetically.

In my use case I have records about plant specimens containing plenty of fields, including e.g. species or life form. These are taxonomy terms. I'm displaying the specimen records in table filterable according to various criteria, e.g. various traits. The table is also sortable according to any column, e.g. species, but in this particular case, it is sorted according to taxonomy term ID and not naturally by label.

I found several answers to similar problems, but nothing exactly fitting my problem. Views Natural Sort module might also help, but its development status is not very promising.
That's because the stored value of the field is the term ID, the label of it is just how it is displayed.

To sort on the name, you need to instead add a relationship using that field to terms, and then add the name field of that relationship. Then you should be able to sort it as well based on that.