Hi Ryan,
For merging cells vertically in a Ms Word table, there must be an element
<w:vMerge w:val="restart"/> in cells that are starting a group
and
<w:vMerge w:val="continue"/> or <w:vMerge/> for other cells
For doing this, you can use parameter "att" to change an attributes in the underlying XML.
But you have to give a value on each row in order to indicate what type of cell it is (restart or continue).
So first, you have to add a column in your data. It can be a real column 'merge' that you calculate yourself using SQL or PHP,
or it can be a virtual colmun added thanks to parameter "ondata" and a custom function.
Example l:
DOCX:
[b;block=w:tr;ondata=f_add_column]
|
PHP:
function f_add_column($BlockName,&$CurrRec,$RecNum) {
static $prev_val='';
if ($prev_val==$CurrRec['category']) {
$CurrRec['merge'] = 'continue';
} else {
$CurrRec['merge'] = 'restart';
$prev_val = $CurrRec['category'];
}
}
|
Now for modifying the attribute: you have to put this somewhere in the row (inside or after the column to merge) :
[b.merge;att=w:vMerge#w:val]
|
BUT that is not all. You also have to be sure that your row actually has the element <w:vMerge>. Otherwise it won't be possible to localize the attribute "w:val".
Unfortunately you can have this element in Ms Word only by actually merging cells. So my suggestion is that you make a copy of the row and then you merge the two cells. Thus there will be two rows for the block, but TBS will consider the two rows as two alternative sections. But such rows will have the element <w:vMerge>.