How to add a button in the header of a table form? I have this table form:

The corresponding code for the header is
$form['inscriptions'] = [
  '#type'   =&gt; 'table',
  '#header' =&gt; [
    [
      'data'    =&gt; '',
      'colspan' =&gt; 2,
    ],
    [
      'data'    =&gt; 'Distribution',
      'colspan' =&gt; 2,
    ],
    [
      'data'    =&gt; 'Réserve',
      'colspan' =&gt; 2,
    ],
    [
      'data'    =&gt; 'Référent',
      'colspan' =&gt; 2,
    ],
  ],
  '#id'     =&gt; 'planningofdistributions',
  '#sticky' =&gt; TRUE,
];

I would like to replace the (empty) content of the first cell by a submit button.
How can I do that?
Finally, I did it this way:
if (some condition) {
  $data = [
    '#type'     =&gt; 'inline_template',
    '#template' =&gt; '&lt;input type=&quot;submit&quot; id=&quot;edit-toggle&quot; name=&quot;button&quot; value=&quot;{{ foo }}&quot; class=&quot;button js-form-submit form-submit&quot;&gt;',
    '#context'  =&gt; ['foo' =&gt; $this-&gt;t('Toggle')],
  ];
}
else {
  $data = '';
}

$form['inscriptions'] = [
  '#type'   =&gt; 'table',
  '#header' =&gt; [
    [
      'data'    =&gt; $data,
      'colspan' =&gt; 2,
    ],
    [
      'data'    =&gt; 'Distribution',
      'colspan' =&gt; 2,
    ],
    [
      'data'    =&gt; 'Réserve',
      'colspan' =&gt; 2,
    ],
    [
      'data'    =&gt; 'Référent',
      'colspan' =&gt; 2,
    ],
  ],
  '#id'     =&gt; 'planningofdistributions',
  '#sticky' =&gt; TRUE,
];