Class TableAlignment

  • java.lang.Object
    • com.aspose.words.TableAlignment
public class TableAlignment 
extends java.lang.Object

Utility class containing constants. Specifies alignment for an inline table.


Shows how to apply an outline border to a table.
Document doc = new Document(getMyDir() + "Tables.docx");
Table table = doc.getFirstSection().getBody().getTables().get(0);

// Align the table to the center of the page.

// Clear any existing borders and shading from the table.

// Add green borders to the outline of the table.
table.setBorder(BorderType.LEFT, LineStyle.SINGLE, 1.5, Color.GREEN, true);
table.setBorder(BorderType.RIGHT, LineStyle.SINGLE, 1.5, Color.GREEN, true);
table.setBorder(BorderType.TOP, LineStyle.SINGLE, 1.5, Color.GREEN, true);
table.setBorder(BorderType.BOTTOM, LineStyle.SINGLE, 1.5, Color.GREEN, true);

// Fill the cells with a light green solid color.
table.setShading(TextureIndex.TEXTURE_SOLID, Color.GREEN, Color.GREEN); + "Table.SetOutlineBorders.docx");

Field Summary
static final intLEFT = 0
The table is aligned to the left.
static final intCENTER = 1
The table is centered.
static final intRIGHT = 2
The table is aligned to the right.

    • Field Detail

      • LEFT = 0

        public static final int LEFT
        The table is aligned to the left.
      • CENTER = 1

        public static final int CENTER
        The table is centered.
      • RIGHT = 2

        public static final int RIGHT
        The table is aligned to the right.