EXAMPLES : Cell type
Cell type
2009-12-09 : Laurent VUIBERT
List of different type
// Load library
require_once('ods/ods.php');
// Create Ods object
$ods = new ods();
$ods->setPath2OdsFiles('ods');
// Create table named 'Cells'
$table = new odsTable('Cells');
// Empty cell
$row = new odsTableRow();
$row->addCell( new odsTableCellString("Empty cell") );
$row->addCell( new odsTableCellEmpty() );
$table->addRow($row);
// String cell
$row = new odsTableRow();
$row->addCell( new odsTableCellString("String cell") );
$row->addCell( new odsTableCellString("String in my cell") );
$table->addRow($row);
// Email cell
$row = new odsTableRow();
$row->addCell( new odsTableCellString("Email cell") );
$row->addCell( new odsTableCellStringEmail("lapinator@gmx.fr") );
$table->addRow($row);
// Url cell
$row = new odsTableRow();
$row->addCell( new odsTableCellString("Url cell") );
$row->addCell( new odsTableCellStringUrl("http://odsphpgenerator.lapinator.net") );
$table->addRow($row);
// Foat cell
$row = new odsTableRow();
$row->addCell( new odsTableCellString("Float cell") );
$row->addCell( new odsTableCellFloat(5.216) );
$table->addRow($row);
// EUR cell
$row = new odsTableRow();
$row->addCell( new odsTableCellString("Euro cell") );
$row->addCell( new odsTableCellCurrency(rand(0,100), 'EUR') );
$row->addCell( new odsTableCellCurrency(-rand(0,100), 'EUR') );
$table->addRow($row);
// USD cell
$row = new odsTableRow();
$row->addCell( new odsTableCellString("Dolars cell") );
$row->addCell( new odsTableCellCurrency(rand(0,100), 'USD') );
$row->addCell( new odsTableCellCurrency(-rand(0,100), 'USD') );
$table->addRow($row);
// GBP cell
$row = new odsTableRow();
$row->addCell( new odsTableCellString("Pounds cell") );
$row->addCell( new odsTableCellCurrency(rand(0,100), 'GBP') );
$row->addCell( new odsTableCellCurrency(-rand(0,100), 'GBP') );
$table->addRow($row);
// Image cell
$row = new odsTableRow();
$row->addCell( new odsTableCellString("Image cell") );
$row->addCell( new odsTableCellImage("imgs/logo.png") );
$table->addRow($row);
$ods->addTable($table);
// Download the file
$ods->downloadOdsFile("multiTable.ods");
Re : Cell type