Ordering Table by column I try to add the possibility to order by column in the header of my table element.

I started to use Drupal 8 and I can't find any clear documentation about table on the API site to do what i want...

Thanks in advance.
You have to do this while defining the header array like

$header = array(
     array(
       'data'  =&gt; t('Url'),
       'field' =&gt; 'd.path',
       'sort'  =&gt; 'asc',
     ),
     array(
       'data'  =&gt; t('Text'),
       'field' =&gt; 'd.text',
     ),
    );


So, this table will have two columns, Url &amp; Text. And it will be sorted in ascending order by column Url.