Aspose::Words::Tables::Table::set_HorizontalAnchor method
Contents
[
Hide
]Table::set_HorizontalAnchor method
Gets the base object from which the horizontal positioning of floating table should be calculated. Default value is Column.
void Aspose::Words::Tables::Table::set_HorizontalAnchor(Aspose::Words::Drawing::RelativeHorizontalPosition value)
Examples
Shows how to work with floating tables properties.
auto doc = System::MakeObject<Aspose::Words::Document>(System::String(get_MyDir() + u"Table wrapped by text.docx"));
System::SharedPtr<Aspose::Words::Tables::Table> table = doc->get_FirstSection()->get_Body()->get_Tables()->idx_get(0);
if (table->get_TextWrapping() == TextWrapping::Around)
{
ASSERT_EQ(table->get_HorizontalAnchor(), RelativeHorizontalPosition::Margin);
ASSERT_EQ(table->get_VerticalAnchor(), RelativeVerticalPosition::Paragraph);
ASPOSE_ASSERT_EQ(table->get_AllowOverlap(), false);
// Only Margin, Page, Column available in RelativeHorizontalPosition for HorizontalAnchor setter.
// The ArgumentException will be thrown for any other values.
table->set_HorizontalAnchor(RelativeHorizontalPosition::Column);
// Only Margin, Page, Paragraph available in RelativeVerticalPosition for VerticalAnchor setter.
// The ArgumentException will be thrown for any other values.
table->set_VerticalAnchor(RelativeVerticalPosition::Page);
}
See Also
- Class Table
- Namespace Aspose::Words::Tables
- Library Aspose.Words for C++