Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Merging Table Cells Dynamically

Using GroupDocs.Assembly for .NET, you can merge table cells with equal textual contents within your reports dynamically using cellMerge tags. Syntax of a cellMerge tag is defined as follows:

...

 

HTML
<table style="background: white; border-collapse: collapse; border: none;">
<tbody>
<tr>
<td style="width: 89.625px; border: 1pt solid windowtext; padding: 0in 5.4pt;">
<p style="margin-bottom: .0001pt; line-height: normal;"><strong><span style="font-family: 'Courier New'; color: #7f7f7f;">...</span></strong></p>
</td>
<td style="width: 368.625px; border-top: 1pt solid windowtext; border-right: 1pt solid windowtext; border-bottom: 1pt solid windowtext; border-image: initial; border-left: none; padding: 0in 5.4pt;">
<p style="margin-bottom: .0001pt; line-height: normal;"><strong><span style="font-family: 'Courier New'; color: #7f7f7f;">...</span></strong></p>
</td>
<td style="width: 98.625px; border-top: 1pt solid windowtext; border-right: 1pt solid windowtext; border-bottom: 1pt solid windowtext; border-image: initial; border-left: none; padding: 0in 5.4pt;">
<p style="margin-bottom: .0001pt; line-height: normal;"><strong><span style="font-family: 'Courier New'; color: #7f7f7f;">...</span></strong></p>
</td>
</tr>
<tr>
<td style="width: 89.625px; border-right: 1pt solid windowtext; border-bottom: 1pt solid windowtext; border-left: 1pt solid windowtext; border-image: initial; border-top: none; padding: 0in 5.4pt;">
<p style="margin-bottom: .0001pt; line-height: normal;"><strong><span style="font-family: 'Courier New'; color: #7f7f7f;">...</span></strong></p>
</td>
<td style="width: 368.625px; border-top: none; border-left: none; border-bottom: 1pt solid windowtext; border-right: 1pt solid windowtext; padding: 0in 5.4pt;">
<p style="margin-bottom: .0001pt; line-height: normal;"><strong><span style="font-family: 'Courier New'; color: #7f7f7f;">&lt;&lt;cellMerge&gt;&gt;&lt;&lt;[</span><span style="font-family: 'Courier New'; color: #7f7f7f;"><span style="font-family: Consolas;">Value1<>Variable1</span></span></strong><strong><span style="font-family: 'Courier New'; color: #7f7f7f;">]&gt;&gt;</span></strong></p>
</td>
<td style="width: 98.625px; border-top: none; border-left: none; border-bottom: 1pt solid windowtext; border-right: 1pt solid windowtext; padding: 0in 5.4pt;">
<p style="margin-bottom: .0001pt; line-height: normal;"><strong><span style="font-family: 'Courier New'; color: #7f7f7f;">...</span></strong></p>
</td>
</tr>
<tr>
<td style="width: 89.625px; border-right: 1pt solid windowtext; border-bottom: 1pt solid windowtext; border-left: 1pt solid windowtext; border-image: initial; border-top: none; padding: 0in 5.4pt;">
<p style="margin-bottom: .0001pt; line-height: normal;"><strong><span style="font-family: 'Courier New'; color: #7f7f7f;">...</span></strong></p>
</td>
<td style="width: 368.625px; border-top: none; border-left: none; border-bottom: 1pt solid windowtext; border-right: 1pt solid windowtext; padding: 0in 5.4pt;">
<p style="margin-bottom: .0001pt; line-height: normal;"><strong><span style="font-family: 'Courier New'; color: #7f7f7f;">&lt;&lt;cellMerge&gt;&gt;&lt;&lt;[</span><span style="font-family: 'Courier New'; color: #7f7f7f;"><span style="font-family: Consolas;">Value2<>Variable2</span></span></strong><strong><span style="font-family: 'Courier New'; color: #7f7f7f;">]&gt;&gt;</span></strong></p>
</td>
<td style="width: 98.625px; border-top: none; border-left: none; border-bottom: 1pt solid windowtext; border-right: 1pt solid windowtext; padding: 0in 5.4pt;">
<p style="margin-bottom: .0001pt; line-height: normal;"><strong><span style="font-family: 'Courier New'; color: #7f7f7f;">...</span></strong></p>
</td>
</tr>
<tr>
<td style="width: 89.625px; border-right: 1pt solid windowtext; border-bottom: 1pt solid windowtext; border-left: 1pt solid windowtext; border-image: initial; border-top: none; padding: 0in 5.4pt;">
<p style="margin-bottom: .0001pt; line-height: normal;"><strong><span style="font-family: 'Courier New'; color: #7f7f7f;">...</span></strong></p>
</td>
<td style="width: 368.625px; border-top: none; border-left: none; border-bottom: 1pt solid windowtext; border-right: 1pt solid windowtext; padding: 0in 5.4pt;">
<p style="margin-bottom: .0001pt; line-height: normal;"><strong><span style="font-family: 'Courier New'; color: #7f7f7f;">...</span></strong></p>
</td>
<td style="width: 98.625px; border-top: none; border-left: none; border-bottom: 1pt solid windowtext; border-right: 1pt solid windowtext; padding: 0in 5.4pt;">
<p style="margin-bottom: .0001pt; line-height: normal;"><strong><span style="font-family: 'Courier New'; color: #7f7f7f;">...</span></strong></p>
</td>
</tr>
</tbody>
</table>
Note

The cellMerge tag works only if value1 Variable1 and value2 Variable2 have the same valuevalues.

.

 Merging Table Cells Dynamically in Word Processing Document 

...