Unable to set default value for checkbox form element inside tableselect
I remember struggling with this for a moment ! The documentation is not so explicit.. 

The tableselect element takes a #default_value array as a multiple select element would do, that is at the same level as the #options array, and with each selected option key being mapped to a truthy value, usually integer 1. 

In the foreach, you would do something like this : 

if ($staging_only) {
  // $row['staging_only']['data']['#attributes'] = array('checked' =&gt; array('checked'));
  $selection[$locale] = 1;
}


And then :

$form['table'] = array(
  '#type' =&gt; 'tableselect',
  '#header' =&gt; $header,
  '#options' =&gt; $options,
  '#default_value' =&gt; $selection,
  '#empty' =&gt; t('No content available.'),
  '#attributes' =&gt; array('id' =&gt; array('locale-table'))
);


Non present options in the selection array default to false so you can ignore unchecked values.