PhpOffice\PhpPresentation\Shape\Group::createTableShape PHP Method

createTableShape() public method

Create table shape
public createTableShape ( integer $columns = 1 ) : Table
$columns integer Number of columns
return Table
    public function createTableShape($columns = 1)
    {
        $shape = new Table($columns);
        $this->addShape($shape);
        return $shape;
    }

Usage Example

Esempio n. 1
0
 public function testAdd()
 {
     $object = new Group();
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart', $object->createChartShape());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Drawing', $object->createDrawingShape());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Line', $object->createLineShape(10, 10, 10, 10));
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->createRichTextShape());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Table', $object->createTableShape());
     $this->assertEquals(5, $object->getShapeCollection()->count());
 }