I’ve attached my project. When the first column is set to a width
of 15%, the “test” row is cut short and doesn’t span the entire
table. I believe when a cell spans more than one column, its
width should be calculated based on cells in adjacent rows.
Here’s what I’m doing in the code:
’ Set the cell width
Call subSetCellWidth(stStateInfo.getAttributeValue(“style”))
’ If this cell spans more than one column, create new cells and merge with previous
If Not IsNothing(stStateInfo.getAttributeValue(“COLSPAN”)) Then
nColspan = CInt(stStateInfo.getAttributeValue(“COLSPAN”))
nCounter = nColspan
If nColspan > 1 Then
wrdDocBuilder.CellFormat.HorizontalMerge = CellMerge.First
Call subAdjustCellIndex(nColspan)
While (nCounter <> 1)
wrdDocBuilder.InsertCell()
wrdDocBuilder.CellFormat.HorizontalMerge = CellMerge.Previous
nCounter -= 1
End While
wrdDocBuilder.MoveToCell(nGetTableIndex(), nGetRowIndex(), nGetColumnIndex(nColspan), 0)
End If
End If
As you can see, I’m setting the width of the cell with the
colspan. Then I’m creating enough cells to create the necessary
colspan amount. Then I move the pointer back to the cell with the
colspan value. This is actually quite a hassle…is there a
better way of handling column span?
Thanks, Natan.