Table — Aspose.Slides FOSS for C++ API Reference

The Table class represents a table shape on a slide. Tables contain rows and columns of cells, each with its own TextFrame.

Namespace: Aspose::Slides::Foss

#include <Aspose/Slides/Foss/table.h>
class Table

Header: include/Aspose/Slides/Foss/table.h


Related Classes

Row

Defined in include/Aspose/Slides/Foss/row.h. Key members:

PropertyDescription
cells()Returns the ICellCollection for this row.
row_format()Row format settings.

Column

Defined in include/Aspose/Slides/Foss/column.h. Key members:

PropertyDescription
cells()Returns the ICellCollection for this column.
column_format()Column format settings.

Cell

Defined in include/Aspose/Slides/Foss/cell.h. Key members:

PropertyAccessorDescription
text_frame()ReadTextFrame containing cell text.
cell_format()ReadCell border and fill format.
text_vertical_type()ReadVertical text orientation.
text_anchor_type()ReadText anchoring within the cell.

RowCollection / ColumnCollection

Iterable collections with methods:

MethodDescription
size()Number of rows/columns.
add_clone(...)Clone and append a row/column.
insert_clone(...)Clone and insert at a position.
remove_at(int index)Remove at index.
begin() / end()Iterator support.

Usage Example

#include <Aspose/Slides/Foss/presentation.h>
using namespace Aspose::Slides::Foss;

Presentation prs("deck.pptx");
// Access a table shape on slide 0
// auto& table = dynamic_cast<Table&>(prs.slides()[0].shapes()[0]);
// for (auto& row : table.rows()) {
//     for (auto& cell : row.cells()) {
//         std::cout << cell.text_frame().text() << "\t";
//     }
//     std::cout << std::endl;
// }

See Also