java.lang.Object
com.aspose.words.CellMerge
public class CellMerge
- extends java.lang.Object
Utility class containing constants.
Specifies how a cell in a table is merged with other cells.
Example:
Creates a table with two rows with cells in the first row horizontally merged.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.insertCell();
builder.getCellFormat().setHorizontalMerge(CellMerge.FIRST);
builder.write("Text in the merged cells.");
builder.insertCell();
// This cell is merged to the previous and should be empty.
builder.getCellFormat().setHorizontalMerge(CellMerge.PREVIOUS);
builder.endRow();
builder.insertCell();
builder.getCellFormat().setHorizontalMerge(CellMerge.NONE);
builder.write("Text in one cell.");
builder.insertCell();
builder.write("Text in another cell.");
builder.endRow();
Example:
Creates a table with two columns with cells merged vertically in the first column.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.insertCell();
builder.getCellFormat().setVerticalMerge(CellMerge.FIRST);
builder.write("Text in the merged cells.");
builder.insertCell();
builder.getCellFormat().setVerticalMerge(CellMerge.NONE);
builder.write("Text in one cell");
builder.endRow();
builder.insertCell();
// This cell is vertically merged to the cell above and should be empty.
builder.getCellFormat().setVerticalMerge(CellMerge.PREVIOUS);
builder.insertCell();
builder.getCellFormat().setVerticalMerge(CellMerge.NONE);
builder.write("Text in another cell");
builder.endRow();
Field Summary |
static final int | NONE | |
The cell is not merged.
|
static final int | FIRST | |
The cell is the first cell in a range of merged cells.
|
static final int | PREVIOUS | |
The cell is merged to the previous cell horizontally or vertically.
|
NONE | |
public static final int NONE |
-
The cell is not merged.
FIRST | |
public static final int FIRST |
-
The cell is the first cell in a range of merged cells.
PREVIOUS | |
public static final int PREVIOUS |
-
The cell is merged to the previous cell horizontally or vertically.
See Also:
Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
Aspose.Words Support Forum - our preferred method of support.