PHP Classes
elePHPant
Icontem

File: sample5.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Max S. Ferreira  >  MsDoc Generator  >  sample5.php  >  Download  
File: sample5.php
Role: Example script
Content type: text/plain
Description: sample with table without grid borders and font changes
Class: MsDoc Generator
Create Microsoft Word document without COM objects
Author: By
Last change:
Date: 8 years ago
Size: 958 bytes
 

Contents

Class file image Download
<?php
   
require_once('clsMsDocGenerator.php');
       
   
$doc = new clsMsDocGenerator();
   
   
$doc->setFontFamily('Times New Roman');
   
$doc->setFontSize('14');

   
$doc->addParagraph('Sample V');
   
$doc->addParagraph('');
   
$doc->addParagraph('table without grid borders and font changes');
   
   
$doc->startTable(NULL, 'tableWithoutGrid');
   
$header = array('header 1', 'header 2', 'header 3', 'header 4');
   
$aligns = array('center', 'center', 'center', 'right');
   
$valigns = array('middle', 'middle', 'middle', 'bottom');
   
$doc->addTableRow($header, $aligns, $valigns, array('font-weight' => 'bold', 'font-size' => '12pt',
                       
'height' => '80pt', 'background-color' => '#FF0000'));
    for(
$row = 1; $row <= 3; $row++){
       
$cols = array();
        for(
$col = 1; $col <= 4; $col++){
           
$cols[] = "column $col; row $row";
        }
       
$doc->addTableRow($cols, NULL, NULL, array('font-size' => '10pt'));
        unset(
$cols);
    }
   
$doc->endTable();

   
$doc->output();
?>