Practical phppptx

Tables

Introduction

phppptx includes methods to insert new tables and fill template tables. The methods allow applying styles, rich tex contents, borders and many other available options.

Adding tables

The method for adding new tables in the active slide is addTable:

This method includes the following parameters:

  • $contents: a multidimensional array with the contents and styles to be added.
  • $position: a new shape is generated to add the content. Coordinate and size values must be set.
  • $tableStyles: table styles.
  • $rowStyles: row styles.
  • $options: extra options.

A very simple table can be created running:

Complex tables can be inserted, adding multiple columns, rowspans, colspans and styles:

Filling tables in a template

As explained on Working with templates, phppptx includes the replaceVariableTable method to fill template tables.

Tips and tricks

phppptx supports all MS PowerPoint table styles to be applied when adding new tables.

Next - Footers