Forum


Replies: 5   Views: 763
Formatear todo el texto de una tabla
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by admin  · 23-11-2021 - 17:14

Hola,

Hemos ejecutado el siguiente código y funciona correctamente:

$docx = new CreateDocx();

$styleOptions = array(
    'borderWidth' => 8,
    'pPrStyles' => array('indentLeft' => 150),
    'rPrStyles' => array('fontSize' => 50),
);

$docx->createTableStyle('myTableStyle', $styleOptions);

$valuesTable = array(
    array(11, 12, 13),
    array(21, 22, 23),
    array(31, 32, 33),
);

$paramsTable = array(
    'tableStyle' => 'myTableStyle',
);

$docx->addTable($valuesTable, $paramsTable);

$docx->createDocx('output');

el tamaño del texto se aplica correctamente para el contenido. Aparte comentar, aunque suponemos que será por un error de copia y pega, que esta línea no es correcta:

$wf->createTableStyle('first_col_table'), $first_col_table_styleOptions);

debería ser:

$wf->createTableStyle('first_col_table', $first_col_table_styleOptions);

Te recomendamos comprobar que el contenido de la tabla no esté añadiendo su propio tamaño de texto (mediante un estilo en línea o con un custom style).

Saludos.