diff --git a/edge.module b/edge.module index b45f264..9c0baa8 100644 --- a/edge.module +++ b/edge.module @@ -144,14 +144,19 @@ function edge_pre_render_table($element) { foreach (element_children($element) as $first) { $row = array('data' => array()); // Apply attributes of first-level elements as table row attributes. - if (isset($element[$first]['#attributes'])) { - $row += $element[$first]['#attributes']; + if (isset($element[$first]['#row_attributes'])) { + $row += $element[$first]['#row_attributes']; } // Turn second-level elements into table row columns. foreach (element_children($element[$first]) as $second) { // Assign the element by reference, so any potential changes to the // original element are taken over. - $row['data'][] = array('data' => &$element[$first][$second]); + $cell = array('data' => &$element[$first][$second]); + // Apply attributes of second-level elements into cell attributes. + if (isset($element[$first][$second]['#cell_attributes'])) { + $cell += $element[$first][$second]['#cell_attributes']; + } + $row['data'][] = $cell; } $element['#rows'][] = $row; }