I'm both glad and a little frustrated to have found this module. Glad because it really ought to exist. Frustrated because I just finished coding my own 'table' element type. However, there's an important feature missing.
In table_element.module on line 274, $row['data'][] = array('data' => &$element[$first][$second]);. However, there is other information that one might want in that array, such as an ID or a colspan for the <td> element. I'd like to request that the cell be able to have an #attributes tag that applies to the <td>. However, since those cells will almost always use their own #attributes tags, it will have to be something else, like #cell.
Simple example:
$items['table_element'] = [
'#type' => 'table',
'#header' => [t('Title'), t('Data')],
'#sticky' => FALSE,
];
$items['table_element'][] = [
'title' => [
'#markup' => 'Title cell',
'#cell' => [
'class' => 'td-element-class',
'data-title' => t('TD element title'),
],
],
'data' => [
'#markup' => 'Data cell',
],
];
Comments
Comment #1
meustrus commentedComment #2
br0kenComment #3
br0kenComment #4
br0kenComment #5
m1r1k commentedComment #6
br0kenChanges already in 7.x-1.0-beta2
Comment #7
br0ken