'Three', 'colspan' => 2]; unset($header['four']); // Set the each row so that column 3 is an array. foreach ($options as $name => $row) { $options[$name]['three'] = [$row['three'], $row['four']]; unset($options[$name]['four']); } // Combine cells in row 3. $options['row3']['one'] = ['data' => $options['row3']['one'], 'colspan' => 2]; unset($options['row3']['two']); $options['row3']['three'] = ['data' => $options['row3']['three'][0], 'colspan' => 2]; unset($options['row3']['four']); return $this->tableselectFormBuilder($form, $form_state, ['#header' => $header, '#options' => $options]); } /** * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { } }