Skip to content

Instantly share code, notes, and snippets.

@bvelastegui
Created May 4, 2017 16:11
Show Gist options
  • Save bvelastegui/bf4c717d75ca366fe57f1a9d0842361c to your computer and use it in GitHub Desktop.
Save bvelastegui/bf4c717d75ca366fe57f1a9d0842361c to your computer and use it in GitHub Desktop.
<?php
$xls = new Excel_Writer_Workbook('prueba.xls');
//creamos nuestro estilo para títulos
$h1 = $xls->addFormat();
$h1->setBold();
$h1->setSize(8);
$h1->setFontFamily('Tahoma');
$h1->setBorder(1);
$h1->setAlign('center');
//creamos nuestro worksheet
$sheet = $xls->addWorksheet('Worksheet 1');
//Agregamos textos en A1 y B1 con el estilo ya definido en $h1
$sheet->write(0, 0, 'Prueba', $h1);
$sheet->write(0, 1, 'php-excel', $h1);
//exportamos nuestro documento
$xls->close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment