Class RowFormat.TablePositioning
Represents the functionalities to absolute position a table when it has text wrap type as around.
Implements
Inherited Members
Namespace: Syncfusion.DocIO.DLS
Assembly: Syncfusion.DocIO.Base.dll
Syntax
public class TablePositioning : FormatBase, IXDLSSerializable
Examples
The following code example demonstrates how to set the absolute position to a table in the document.
private void Button1_Click(System.Object sender, System.EventArgs e)
{
//Create an instance of WordDocument class (Empty Word Document)
WordDocument document = new WordDocument();
//Open an existing Word document into DocIO instance
document.Open("Table.docx", FormatType.Docx);
//Access the instance of the first section in the Word document
WSection section = document.Sections[0];
//Access the instance of the first table in the section
WTable table = section.Tables[0] as WTable;
//Specify the table positioning options
table.TableFormat.Positioning.HorizPositionAbs = HorizontalPosition.Right;
table.TableFormat.Positioning.HorizRelationTo = HorizontalRelation.Margin;
table.TableFormat.Positioning.VertPositionAbs = VerticalPosition.Center;
table.TableFormat.Positioning.VertRelationTo = VerticalRelation.Page;
table.TableFormat.Positioning.DistanceFromBottom = 10;
table.TableFormat.Positioning.DistanceFromLeft = 10;
table.TableFormat.Positioning.DistanceFromRight = 10;
table.TableFormat.Positioning.DistanceFromTop = 10;
//Save and close the Word document instance
document.Save("Sample.docx", FormatType.Docx);
document.Close();
}
Private Sub button_Click(sender As Object, e As EventArgs)
'Create an instance of WordDocument class (Empty Word Document)
Dim document As New WordDocument()
'Open an existing Word document into DocIO instance
document.Open("Table.docx", FormatType.Docx)
'Access the instance of the first section in the Word document
Dim section As WSection = document.Sections(0)
'Access the instance of the first table in the section
Dim table As WTable = TryCast(section.Tables(0), WTable)
'Specify the table positioning options
table.TableFormat.Positioning.HorizPositionAbs = HorizontalPosition.Right
table.TableFormat.Positioning.HorizRelationTo = HorizontalRelation.Margin
table.TableFormat.Positioning.VertPositionAbs = VerticalPosition.Center
table.TableFormat.Positioning.VertRelationTo = VerticalRelation.Page
table.TableFormat.Positioning.DistanceFromBottom = 10
table.TableFormat.Positioning.DistanceFromLeft = 10
table.TableFormat.Positioning.DistanceFromRight = 10
table.TableFormat.Positioning.DistanceFromTop = 10
'Save and close the Word document instance
document.Save("Sample.docx", FormatType.Docx)
document.Close()
End Sub
Properties
DistanceFromBottom
Gets or sets the distance between the table and the text below the table.
Declaration
public float DistanceFromBottom { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The float that specifies the distance from the bottom. |
DistanceFromLeft
Gets or sets the distance between the table and the text to the left of table.
Declaration
public float DistanceFromLeft { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The float that specifies the distance from the left. |
DistanceFromRight
Gets or sets the distance between the table and the text to the right of table.
Declaration
public float DistanceFromRight { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The float that specifies the distance from the right. |
DistanceFromTop
Gets or sets the distance between the table and the text above the table .
Declaration
public float DistanceFromTop { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The float that specifies the distance from the top. |
HorizPosition
Gets or sets the horizontal position for the table.
Declaration
public float HorizPosition { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The float that specifies the vertical position. |
HorizPositionAbs
Gets or sets the absolute horizontal position for the table.
Declaration
public HorizontalPosition HorizPositionAbs { get; set; }
Property Value
Type | Description |
---|---|
HorizontalPosition | The HorizontalPosition member that specifies the position. |
HorizRelationTo
Gets or sets the horizontal relation of the table.
Declaration
public HorizontalRelation HorizRelationTo { get; set; }
Property Value
Type | Description |
---|---|
HorizontalRelation |
VertPosition
Gets or sets the vertical position for the table.
Declaration
public float VertPosition { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The float that specifies the vertical position. |
VertPositionAbs
Gets or sets the absolute vertical position for the table.
Declaration
public VerticalPosition VertPositionAbs { get; set; }
Property Value
Type | Description |
---|---|
VerticalPosition | The VerticalPosition member that specifies the position. |
VertRelationTo
Gets or sets the vertical relation of the table.
Declaration
public VerticalRelation VertRelationTo { get; set; }
Property Value
Type | Description |
---|---|
VerticalRelation |
Methods
GetDefValue(Int32)
Returns the default values.
Declaration
protected override object GetDefValue(int key)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | key | The integer that specifies the key. |
Returns
Type | Description |
---|---|
System.Object | An object that specifies the default value. |