Table
The Table
class, a dynamic feature within the OpenXMLOffice.Presentation
library, provides developers with a robust toolset for effortlessly incorporating tables into PowerPoint presentations. This class offers extensive support for diverse table configurations, allowing users to create, modify, and enhance tables in a slide with ease. Developers can leverage the Table class to add new tables.
Basic Code Sample
TableSetting
Options
TableSetting
Optionsname
string
Table Internal name for reference. Default: Table 1
height
uint
Table overall height in EMU. Note: If the specified height is insufficient, the PowerPoint (PPT) application will automatically use the minimum required height. Default : 741680
width
uint
Table overall width in EMU Default : 8128000
x
uint
This parameter precisely determines the X position of the entire chart. Default: 0
y
uint
This parameter precisely determines the Y position of the entire chart. Default : 0
widthType
This parameter affects how value in tableColumnWidth
is been used. Refer additional details.
Default : Auto
tableColumnWidth
List<float>
The float value is accessed or ignored based on widthType
setting.
TableRow
Options
TableRow
Optionsheight
int
Configures row height, measured in EMU (English Metric Unit). Default : 370840
rowBackground
string?
Configure row background color using hex code (without #).
textColor
string
Configure row text color using hex code (without #).
TableCell
Options
TableCell
Optionsvalue
string?
Value of specific table cell
rowSpan
uint
Number of cell Rows of same column to be merged
columnSpan
uint
Number of cell Columns to be merged in same row
horizontalAlignment
HorizontalAlignmentValues?
Horizontal alignement property
verticalAlignment
VerticalAlignmentValues?
Vertical alignement property
cellBackground
string?
Cell Specific background color
textColor
string
Cell Specific text color
fontFamily
string
Cell Specific font family
fontSize
int
Cell Specific font size
isBold
bool
Set cell content bold
isItalic
bool
Set cell content Italic
isUnderline
bool
Set cell content underline status
TableBorderSettings
Options
TableBorderSettings
OptionsTableBorderSetting
Options
TableBorderSetting
OptionsshowBorder
bool
Set border status
borderColor
string
Set border color
width
float
Set border width
borderStyle
BorderStyleValues
Border line style
dashStyle
DrawingPresetLineDashValues
Border dash style
WidthOptionValues
*Width Type additional Details
WidthOptionValues
*Width Type additional DetailsAUTO
Ignore User Width value and space the colum equally.
EMU
(English Metric Units) Direct PPT standard Sizing 1 Inch * 914400 EMU's
PIXEL
Based on Target DPI the pixel is converted to EMU and used when running
PERCENTAGE
0-100 Width percentage split for each column
RATIO
0-10 Width ratio of each column