diff --git a/core/lib/Drupal/Core/Render/Element/Table.php b/core/lib/Drupal/Core/Render/Element/Table.php index 2da6ef96da0..75bcab5544c 100644 --- a/core/lib/Drupal/Core/Render/Element/Table.php +++ b/core/lib/Drupal/Core/Render/Element/Table.php @@ -33,7 +33,8 @@ use Drupal\Component\Utility\Html as HtmlUtility; * '#header' => array($this->t('Name'), $this->t('Phone')), * ); * - * for ($i=1; $i<=4; $i++) { + * for ($i = 1; $i <= 4; $i++) { + * $form['contacts'][$i]['#attributes'] = array('class' => array('foo', 'baz')); * $form['contacts'][$i]['name'] = array( * '#type' => 'textfield', * '#title' => $this->t('Name'), @@ -46,6 +47,11 @@ use Drupal\Component\Utility\Html as HtmlUtility; * '#title_display' => 'invisible', * ); * } + * + * $form['contacts'][]['colspan_example'] = array( + * '#plain_text' => 'Colspan Example', + * '#wrapper_attributes' => array('colspan' => 2, 'class' => array('foo', 'bar')), + * ); * @endcode * @see \Drupal\Core\Render\Element\Tableselect *