¿Podrias colocar el código de como estas haciendolo?
Mira para resolver lo que ahora necesitas debes aplicar SetXY().
Cita: SetXY
SetXY(float x, float y)
Description
Defines the abscissa and ordinate of the current position. If the passed values are negative, they are relative respectively to the right and bottom of the page.
Parameters
x
The value of the abscissa.
y
The value of the ordinate.
Tambien recuerda que los parametros para CellfitSpace() son estos, siguiendo la sintaxis:
Código PHP:
Ver originalCellFit
(float w
[, float h
[, string txt
[, mixed border
[, int ln
[, string align
[, boolean fill
[, mixed
link [, boolean scale
[, boolean force
]]]]]]]]])
Ejemplo:
Código PHP:
Ver original<?php
require('cellfit.php');
$txt_short = 'This text is short enough.';
$txt_long = 'This text is way too long.';
for ($i = 1; $i <= 2; $i++)
$txt_long.=' '.$txt_long;
$pdf = new FPDF_CellFit();
$pdf->AddPage();
$pdf->SetFillColor(0xff,0xff,0x99);
$pdf->SetFont('Arial','B',16);
$pdf->SetFont('','B');
$pdf->Write(10,'Ejemplo');
$pdf->SetFont('');
$pdf->SetXY(10,30);
$pdf->CellFitSpace(0,10,$txt_long,1,1,'',1);
$pdf->SetXY(20,40);
$pdf->CellFitSpace(60,10,$txt_short,1,1);
$pdf->SetXY(30,50);
$pdf->CellFitSpace(0,10,$txt_long,1,1,'',1);
$pdf->SetXY(40,60);
$pdf->CellFitSpace(60,10,$txt_short,1,1);
$pdf->Output();
?>
Resultado:
Te recomiendo que codifiques 3 funciones en el archivo cellfit.php, utilizando claro esta Cellfitspace() en estas, en estas funciones establezcas los parametros y configuraciones para mostrar las tablas sin necesidad de configurar cada celda.
Las funciones serian: una para la cabecera, otra para los datos en las celdas y otra para juntas estas dos, para poder utilizar esto que te recomiendo podrias capturar los datos de la base en un array dandole como indices los nombres que quieres que aparezcan en la cabecera, para los datos de la cabecera seria igual un array con los nombres que le daras a cada una, en fin espero entiendas y no haberte confundido, no soy un experto pero intento ayudarte.
Avisanos si te sirvio.
Saludos