By Fluffy Convict on
I'm trying to use the theme_table API to form a table row that looks like this:
<tr id="more_142"><td colspan="7"><span>foo!</span></td></tr>
I can't seem to get the array right. I've tried, among others:
$row[] = array(
'data' => array('data' => '<span>foo!</span>', 'colspan' => 7), 'id' => 'more_'. $story->nid
);
result:
<tr><td id="more_142">Array</td></tr>
$row[] = array(
'data' => '<span>foo!</span>', 'colspan' => 7, 'id' => 'more_'. $story->nid
);
result:
<tr><td colspan="7" id="more_142">foo!</td></tr>
Who could help me with the correct syntax to get the output I want?
Comments
It helps to think in terms
It helps to think in terms of rows and a single row, so using $rows as what you would pass to the theme function this should get you going
Thanks, almost there...
I now have
It returns
Why does the "7" of colspan gets turned into another td? How would I have to change the php to get following outcome?
Sorry, missed part of $rows,
Sorry, missed part of $rows, it should look like
Each row show be an array of cells (the outer array), each cell can be just a value or an array as in this case.