source: extensions/GrumPluginClasses/classes/External/odsPhpGenerator/examples/ColumnWidth.php @ 17735

Last change on this file since 17735 was 17735, checked in by grum, 12 years ago

version 3.5.4 - fix minor bug & add new functions to framework

  • Property svn:executable set to *
File size: 901 bytes
Line 
1<?php
2
3// Load library
4require_once('../ods.php');
5
6// Create Ods object
7$ods  = new ods();
8
9$table = new odsTable('Column Width');
10
11// create column width 1cm   
12$styleColumn = new odsStyleTableColumn();
13$styleColumn->setColumnWidth("1cm");
14$column1 = new odsTableColumn($styleColumn);
15
16// create column width 7cm
17$styleColumn = new odsStyleTableColumn();
18$styleColumn->setColumnWidth("7cm");
19$column2 = new odsTableColumn($styleColumn);
20
21// add 2 1cm column
22$table->addTableColumn($column1);
23$table->addTableColumn($column1);
24
25// add 1 7cm column
26$table->addTableColumn($column2);
27
28// Create data
29$table->addRow($row = new odsTableRow());
30$row->addCell( new odsTableCellString("1cm"));
31$row->addCell( new odsTableCellString("1cm"));
32$row->addCell( new odsTableCellString("7cm ..."));
33
34// Add table to ods
35$ods->addTable($table);
36
37// Download the file
38$ods->downloadOdsFile("ColumnWidth.ods");
39 
40?>
Note: See TracBrowser for help on using the repository browser.