From af89f803d073fdb6710604c95a67e59097417af8 Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Tue, 25 Oct 2016 13:19:43 -0700 Subject: [PATCH] Issue #2803923 by gianani, shashikant_chauhan, joachim: Table render element docs don't explain how to do colspan --- core/lib/Drupal/Core/Render/Element/Table.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 *