This is the respective issue as for D8, which introduced a new '#type' => 'table' form element in the core Form API (change record: It comes with built-in, optional support for TableDrag and TableSelect, and it requires no more custom plumbing for most use-cases.

Building and rendering a table required to write a custom/dedicated theme function for most tables in Drupal 7. TableSelect (bulk operations) and TableDrag (drag & drop) support had to be added and attached manually when necessary. This led to many duplicate/unnecessary theme functions, which in turn made it hard for other modules to enhance or alter a table.

This was suggested to be backported to D7, but was rejected, with the recommendation to implement it in contrib (in specifically). Someone backported the D8 version to a dedicated contrib in (only 300 lines of code in a single .module file; including comments:

PS: if we decide to do this, then this issue is also related, and we should create a separate meta-issue for it, to convert all tables in core to the new '#type' => 'table':

GitHub Issue #: