More problems with the tables in DOMPDF

6,922 views
Skip to first unread message

INGEDAY

unread,
Nov 28, 2009, 8:29:03 AM11/28/09
to dompdf
I have a problem with generating a PDF with tables, all that lies at
the end of a line two things will happen:

1. He leaves the table (even with padding of 20px)
2. Or the last word in the previous overlap, making it difficult to
read the document.

In other categories sometimes succeeds, as it should go.

In group attachments I uploaded a document called "fps_14_090533.pdf"
to see what happens. If someone can help me appreciate it.

Thank you.

_________________________________________________

Tengo un problema con al generar un PDF con tablas, todo radica que al
terminar una linea pueden suceder dos cosas:

1. Se sale de la tabla (aún teniendo padding de 20px)
2. O la ultima palabra se superpone en la anterior, dificultando la
lectura del documento.

En otros renglones a veces sale bien, como debería salir.

En los archivos adjuntos del grupo he subido un documento llamado
"fps_14_090533.pdf" para que vean que es lo que sucede. Si alguién
puede ayudarme se lo agradecería.

Gracias.

INGEDAY

unread,
Nov 28, 2009, 9:06:00 AM11/28/09
to dompdf
Here is the HTML source of the entire table: Testing!!!

Aqui está el codigo HTML de toda la tabla:



####################

<html><head><style type="text/css">
body{
font-size:10px;
margin-top:200px;
margin-left:30px;
margin-right:0px;
margin-bottom:70px;
}
table th{
background-color:#333333;
color:#CCCCCC;
}
table{
/*border-collapse:collapse;*/
border-collapse:collapse;
}
table td{
font-size:10px;
padding-right:20px;
padding-left:20px;
text-align:justify;
border:#2C7AB8 1px solid;
}
table td.titCabecera {
font-size:12px;
text-align:left;
}
table tr{
border:1px solid #2C7AB8;
}
p{
text-align:justify;
}
h2{
color:#003366;
border-bottom:#003366 solid 3px;
}
.titulo {
color:#FFF;
text-align:center;
font-weight:bold;
}
</style></head><body><script type="text/php">
$u="Eday Alix Gonzalez";
$header=$pdf->open_object();
$font = Font_Metrics::get_font("verdana", "bold");
$nameColegio = "COLEGIO MARIA MONTESSORI - CALIDAD TOTAL EN
EDUCACION";
$informeAcademico="INFORME FINAL";
$nombreEstTitle="Nombre del Estudiante: ";
$nombreEstudiante=$u;
$gradoTitle="Grado: ";
$gradoEst="11";
$anioTitle="Año: ";
$anio="2009";
$hpagina = $pdf->get_height();
$wpagina = $pdf->get_width();
$wtexto = Font_Metrics::get_text_width($nameColegio, $font, 14);
$wNombreEstTitle = Font_Metrics::get_text_width($nombreEstTitle,
$font, 14);
$pdf->image("images/logo_montessori.png", "png", $wpagina-
$wpagina*0.92, 40, 80, 80);
$pdf->page_text($wpagina/2-200 , $hpagina-$hpagina*0.90,
$nameColegio , $font , 14, array(0,0,255));
$pdf->page_text($wpagina/2-80 , $hpagina-$hpagina*0.85,
$informeAcademico , $font , 14, array(0,0,255));
/*$pdf->page_text($wpagina-$wpagina*0.92, 120, $nombreEstTitle,
$font , 14, array(0,0,255));
$pdf->page_text($wNombreEstTitle+75 , 120, $nombreEstudiante, $font ,
14, array(0,0,255));
$pdf->page_text(450, 120, $gradoTitle , $font, 14, array(0,0,255));
$pdf->page_text(500, 120, $gradoEst , $font, 14, array(0,0,255));
$pdf->page_text($wpagina-$wpagina*0.15, 120, $anioTitle , $font, 14,
array(0,0,255));
$pdf->page_text($wpagina-$wpagina*0.10, 120, $anio , $font, 14, array
(0,0,255));*/
$pdf->page_text($wpagina/2 , $hpagina-35, "{PAGE_NUM}" , $font, 10,
array(0,0,255));
$pdf->page_text($wpagina-$wpagina*0.30 , $hpagina-35, "Código FPS-13
Versión: 03, 25 de Julio de 2009" , $font, 6, array(0,0,255));
$pdf->page_text($wpagina-$wpagina*0.92 , $hpagina-35, "SGC Master v.
0.4" , $font, 6, array(0,0,255));
$pdf->close_object();
$pdf->add_object($header, "all");
</script><table border="0" style="width:960px;" cellpadding="0"
cellspacing="0" align="center">
<tr><td class="titCabecera" colspan="4" width="360">NOMBRE DEL
ESTUDIANTE: VARGAS REDONDO VICTOR ALEXANDER</td><td
class="titCabecera" width="140">GRADO: <span style="text-
transform:uppercase;">Quinto</span></td><td class="titCabecera"
width="100">PERIODO: 5</td><td class="titCabecera"
width="100">A&Ntilde;O: 2009</td></tr>
</table><br /><br /><table id="notas" style="width:960px;"
cellpadding="0" cellspacing="0" align="center">
<tr style="border:1px solid #FFF;
background:#2C7AB8; color:#FFF;">
<td class="titulo" style="text-align:center;
width:130px">AREA Y/O ASIGNATURA</td><!--<td>INT/H</td>-->


<td class="titulo" style="text-align:center; width:
60px;">FALLAS</td><td class="titulo" colspan="2" style="text-
align:center; width:110px; text-align:center; padding:
0px;">VALORACI&Oacute;N</td><td class="titulo" style="text-
align:center; width:660px;" colspan="3">DESCRIPCI&Oacute;N</td>
<td>&nbsp;</td></tr><tr style="border:1px solid
#2c7ab8;" class="font10menu"><td style="font-weight:bold; text-
align:left; width:130px;">CIENCIAS NATURALES Y EDUCACION AMBIENTAL:
BIOLOGIA-QUIMICA</td><td style="text-align:center; width:60px;">6</
td><td style="text-align:center; width:55px;">80</td><td style="text-
align:center; width:55px;">S</td><td style="width:660px"
colspan="3"><div style="padding:20px; padding-right:50px; text-
align:left;"><p>- Durante el transcurso del año escolar alcanzó de
manera sobresaliente los logros propuestos por la asignatura.
Identificó excelentemente la función de la célula y su clasificación.
Reconoció los tipos de relación interna y externa de los seres vivos.
Estableció semejanzas y diferencias entre los procesos fisicos y
quimicos de la materia. Describío las características de los planetas
que conforman el sistema solar.
</p>&nbsp;&nbsp;</div></td><td style="background-
color:#2c7ab8;">&nbsp;</td></tr><tr style="border:1px solid #2c7ab8;"
class="font10menu"><td style="font-weight:bold; text-align:left; width:
130px;">CIENCIAS NATURALES Y EDUCACION AMBIENTAL: FISICA</td><td
style="text-align:center; width:60px;">3</td><td style="text-
align:center; width:55px;">80</td><td style="text-align:center; width:
55px;">S</td><td style="width:660px" colspan="3"><div style="padding:
20px; padding-right:50px; text-align:left;"><p>- Durante el transcurso
del año escolar alcanzó de manera sobresaliente los logros propuestos
por la asignatura. Describió las formas de energía y la importancia
del manejo adecuado de las mismas. Identifico y describir el sonido
como una manifestación de la energía. Describió y explico el sonido
como resultado de un movimiento ondulatorio. Reconoció los elementos y
propiedades de la luz. Comparo las formas en que se transmite el
calor en los cuerpos. Explico el funcionamiento de un circuito
eléctrico básico y presenta ejemplos de uso cotidiano. Describió el
fenómeno de las ondas como una manifestación del movimiento.</
p>&nbsp;&nbsp;</div></td><td style="background-color:#2c7ab8;">&nbsp;</
td></tr><tr style="border:1px solid #2c7ab8;" class="font10menu"><td
style="font-weight:bold; text-align:left; width:130px;">CIENCIAS
SOCIALES</td><td style="text-align:center; width:60px;">0</td><td
style="text-align:center; width:55px;">73</td><td style="text-
align:center; width:55px;">A</td><td style="width:660px"
colspan="3"><div style="padding:20px; padding-right:50px; text-
align:left;"><p>- Su rendimiento académico fue aceptable, con esfuerzo
identifica los principales hechos y datos de la historia colombiana en
la época de la república de la nueva granada, se ubica en el contexto
histórico en el que se produjeron los hechos que dieron origen a los
partidos políticos, reconoce la relación que existe entre los tres
sectores en que se agrupan las actividades productivas del país.
Requiere de más dedicación, organización y responsabilidad en sus
actividades.</p>&nbsp;&nbsp;</div></td><td style="background-
color:#2c7ab8;">&nbsp;</td></tr><tr style="border:1px solid #2c7ab8;"
class="font10menu"><td style="font-weight:bold; text-align:left; width:
130px;">EDUCACION ARTISTICA Y CULTURAL</td><td style="text-
align:center; width:60px;">1</td><td style="text-align:center; width:
55px;">96</td><td style="text-align:center; width:55px;">E</td><td
style="width:660px" colspan="3"><div style="padding:20px; padding-
right:50px; text-align:left;"><p>- Durante el año escolar su
rendimiento en la asignatura fue excelente, tiene un gran espíritu
artístico, muy buenas habilidades motrices. Le agrada realizar
trabajos manuales con estética. Felicitaciones sigue cultivando tu
amor por el arte</p>&nbsp;&nbsp;</div></td><td style="background-
color:#2c7ab8;">&nbsp;</td></tr><tr style="border:1px solid #2c7ab8;"
class="font10menu"><td style="font-weight:bold; text-align:left; width:
130px;">EDUCACION ETICA Y EN VALORES HUMANOS</td><td style="text-
align:center; width:60px;">0</td><td style="text-align:center; width:
55px;">79</td><td style="text-align:center; width:55px;">A</td><td
style="width:660px" colspan="3"><div style="padding:20px; padding-
right:50px; text-align:left;"><p>- En ocasiones compara sus aportes
con los de sus compañeros y compañeras incorpora en sus conocimientos
y juicios elementos valiosos aportados por otros. Su rendimiento
académico necesitó de muchos llamados de atención para que trabajara a
tiempo las actividades plantedas, le faltó mas interés, concentración
y resposabilidad para desarrollar de manera eficaz los ejercicios
propuestos en la fichas de trabajo.Se le recomienda cambiar de actitud
ya que posee todas las capacidades para obtener excelentes
resultados.</p>&nbsp;&nbsp;</div></td><td style="background-
color:#2c7ab8;">&nbsp;</td></tr><tr style="border:1px solid #2c7ab8;"
class="font10menu"><td style="font-weight:bold; text-align:left; width:
130px;">EDUCACION FISICA, RECREACION Y DEPORTE</td><td style="text-
align:center; width:60px;">4</td><td style="text-align:center; width:
55px;">96</td><td style="text-align:center; width:55px;">E</td><td
style="width:660px" colspan="3"><div style="padding:20px; padding-
right:50px; text-align:left;"><p>- Utiliza con amplitud y
profundización los logros del área. Cumple con las normas
establecidas. Felicitaciones por tu excelente rendimiento.

</p>&nbsp;&nbsp;</div></td><td style="background-
color:#2c7ab8;">&nbsp;</td></tr><tr style="border:1px solid #2c7ab8;"
class="font10menu"><td style="font-weight:bold; text-align:left; width:
130px;">EDUCACION RELIGIOSA</td><td style="text-align:center; width:
60px;">0</td><td style="text-align:center; width:55px;">65</td><td
style="text-align:center; width:55px;">A</td><td style="width:660px"
colspan="3"><div style="padding:20px; padding-right:50px; text-
align:left;"><p>- Reconoce que hay personas sagradas dentro de la
creencia de los cristianos los cuales debemos respetar y venerar.Con
esfuerzo pudo superar las debilidades en el área, logrando alcanzar
los logros mínimos. Su rendimiento durante el año fue aceptable.Se le
recomienda repasar los temas trabajados durante el año.</
p>&nbsp;&nbsp;</div></td><td style="background-color:#2c7ab8;">&nbsp;</
td></tr><tr style="border:1px solid #2c7ab8;" class="font10menu"><td
style="font-weight:bold; text-align:left; width:130px;">HUMANIDADES:
LENGUA CASTELLANA</td><td style="text-align:center; width:60px;">3</
td><td style="text-align:center; width:55px;">70</td><td style="text-
align:center; width:55px;">A</td><td style="width:660px"
colspan="3"><div style="padding:20px; padding-right:50px; text-
align:left;"><p>- En el transcurso del año escolar su desempeño en la
asignatura fue aceptable, comprendió algunos temas de gramática,
literatura, comunicación y ortografía. Su ritmo de trabajo fue lento
por la falta de apropiación de conceptos. Se le recomienda reforzar
los temas vistos durante todos los niveles, para obtener mejores
resultados el próximo año y un mejor desenvolvimiento en la
asignatura.</p>&nbsp;&nbsp;</div></td><td style="background-
color:#2c7ab8;">&nbsp;</td></tr><tr style="border:1px solid #2c7ab8;"
class="font10menu"><td style="font-weight:bold; text-align:left; width:
130px;">HUMANIDADES: IDIOMA EXTRANJERO</td><td style="text-
align:center; width:60px;">4</td><td style="text-align:center; width:
55px;">73</td><td style="text-align:center; width:55px;">A</td><td
style="width:660px" colspan="3"><div style="padding:20px; padding-
right:50px; text-align:left;"><p>- Alcanzó con dificultad los logros
propuestos en el área, demostrando un aceptable nivel de comprensión
en los temas trabajados.
</p>&nbsp;&nbsp;</div></td><td style="background-
color:#2c7ab8;">&nbsp;</td></tr><tr style="border:1px solid #2c7ab8;"
class="font10menu"><td style="font-weight:bold; text-align:left; width:
130px;">MATEMATICAS</td><td style="text-align:center; width:60px;">2</
td><td style="text-align:center; width:55px;">80</td><td style="text-
align:center; width:55px;">S</td><td style="width:660px"
colspan="3"><div style="padding:20px; padding-right:50px; text-
align:left;"><p>- Resuelve situaciones que involucren datos del
pensamiento numérico: naturales, fracciones y decimales, pensamiento
métrico y aleatorio.
La proposición de alternativas matemáticas a partir de graficas y
tablas en ocasiones no es la apropiada, continúe practicando la
lectura comprensiva para aumentar sus competencias en la solución de
problemas.
Finalizó las temáticas propuestas para el grado, puede llegar
fácilmente a la excelencia.

</p>&nbsp;&nbsp;</div></td><td style="background-
color:#2c7ab8;">&nbsp;</td></tr><tr style="border:1px solid #2c7ab8;"
class="font10menu"><td style="font-weight:bold; text-align:left; width:
130px;">TECNOLOGIA E INFORMATICA</td><td style="text-align:center;
width:60px;">0</td><td style="text-align:center; width:55px;">90</
td><td style="text-align:center; width:55px;">S</td><td style="width:
660px" colspan="3"><div style="padding:20px; padding-right:50px; text-
align:left;"><p>- Durante el transcurso del año escolar alcanzó de
manera sobresaliente los logros propuestos en la asignatura. Con un
poco más de dedicación y constancia podrás obtener la excelencia y la
calidad total en tu formación ¡¡¡Ánimo!!!
</p>&nbsp;&nbsp;</div></td><td style="background-
color:#2c7ab8;">&nbsp;</td></tr><tr style="border:1px solid #2c7ab8;"
class="font10menu"><td style="font-weight:bold; text-align:left; width:
130px;">FILOSOFIA</td><td style="text-align:center; width:60px;">0</
td><td style="text-align:center; width:55px;">78</td><td style="text-
align:center; width:55px;">A</td><td style="width:660px"
colspan="3"><div style="padding:20px; padding-right:50px; text-
align:left;"><p>- En ocasiones reconoce y respeta diferentes puntos
de vida acerca de un fenómeno social.Generalmente participa en debates
y discusiones: asume una posición, la confronta con las de otros, la
defiende y es capaz de modificar sus posturas si lo considera
pertinente.Durante el año se le llamó la atención para que trabajara a
tiempo y de manera eficaz las actividades asignadas en el área, se le
observó poco interés y resposabilidad frente al desarrollo de los
ejercicios propuestos. Se le recomienda cambiar de actitud para
obtener mejores resultados, ya que posee todas las capacidades para
alcanzar de manera excelente los objetivos del área. Ánimo!!</
p>&nbsp;&nbsp;</div></td><td style="background-color:#2c7ab8;">&nbsp;</
td></tr><tr style="border:1px solid #2c7ab8;" class="font10menu"><td
style="font-weight:bold; text-align:left; width:130px;">SCIENCE</
td><td style="text-align:center; width:60px;">4</td><td style="text-
align:center; width:55px;">70</td><td style="text-align:center; width:
55px;">A</td><td style="width:660px" colspan="3"><div style="padding:
20px; padding-right:50px; text-align:left;"><p>- Alcanzó con
dificultad los logros propuestos en el área, demostrando un aceptable
nivel de comprensión en los temas trabajados.
</p>&nbsp;&nbsp;</div></td><td style="background-
color:#2c7ab8;">&nbsp;</td></tr></table><br /><br /><br /><br /><table
style="width:960px;" cellpadding="0" cellspacing="0"
align="center"><tr style="border:1px solid #FFF;" class="font10menu">
<td style="font-weight:bold; text-align:left"
style="width:130px;">Comportamiento: Durante el año escolar el
estudiante mostró un excelente comportamiento, centrado en los
valores; en ocasiones le faltó dedicación con el estudió, pero se
esforzó y se interesó por obtener buenos resultados.Felicitaciones</
td></tr><tr style="border:1px solid #FFF;" class="font10menu">

<td style="font-weight:bold; text-align:left"
style="width:130px;">Observaciones:Es promovido al grado sexto. Feliz
Navidad y prospero año nuevo</td></tr></table><br /><br /><br /><br /
><table border="0" style="width:890px; border:none;" cellpadding="0"
cellspacing="0" align="center"><tr>
<td width="196"><div style="padding-left:20px; padding-right:
20px;"><img src="demov2.0/modulos/Usuarios/images/firmaDocentes/
nofirma.jpg" width="150" height="100" /><hr />RECTOR:</div></td>
<td width="296"><div width="196" style="padding-left:20px;
padding-right:20px;"><img src="demov2.0/modulos/Usuarios/images/
firmaDocentes/secretario.jpg" width="150" height="100" /><hr /
>SECRETARIO ACADEMICO:</div></td>
<td width="198"><div style="padding-left:20px; padding-right:
20px;"><img src="demov2.0/modulos/Usuarios/images/firmaDocentes/
36516447.jpg" height="100" /><hr />GU&Iacute;A DE GRUPO:</div></td>
</tr></table></body></html>

####################

Thanks

BrianS

unread,
Dec 1, 2009, 3:36:19 PM12/1/09
to dompdf
On Nov 28, 8:29 am, INGEDAY <elpapie...@gmail.com> wrote:
> I have a problem with generating a PDF with tables, all that lies at
> the end of a line two things will happen:
>
> 1. He leaves the table (even with padding of 20px)
> 2. Or the last word in the previous overlap, making it difficult to
> read the document.
>
> In other categories sometimes succeeds, as it should go.
>
> In group attachments I uploaded a document called "fps_14_090533.pdf"
> to see what happens. If someone can help me appreciate it.
>
> Thank you.

I have been unable to duplicate your issue with text leaving a table
cell. It could partially be due to the fact that Google Groups tends
to mangle code posted via the web interface. If you could post your
sample document to, say, you own web server and provide a link I'll
perform some additional testing.

I did notice a discrepancy between the alpha release and the
development version. I was getting some overlap in the alpha that I'm
not seeing in the most recent version in the repository. Typically
text issues such as the two you listed can be due to missing or
incorrect metric information for supported characters.

Since I'm not seeing the issue in the current dev version perhaps the
next release will see your problem addressed. In the meantime you can
always try to work around problems with the core fonts by using one of
your own.

INGEDAY

unread,
Dec 6, 2009, 1:09:52 AM12/6/09
to dompdf
Hi,

Here is the link...

http://www.colmariamontessori.edu.co/PRUEBA_PDF.php?u=victorv (HTML)

In group attachments I uploaded a document called
"fps_14_090533.pdf" (PDF)

BrianS

unread,
Dec 8, 2009, 2:12:55 PM12/8/09
to dompdf
I was able to duplicate your problem using DOMPDF 0.6.0 alpha 2. The
issue has already been addressed in the latest dev version of DOMPDF.
You can see the improved rendering here:
http://eclecticgeek.com/dompdf/index.php?input_file_http=http%3A%2F%2Fwww.colmariamontessori.edu.co%2FPRUEBA_PDF.php%3Fu%3Dvictorv&paper=letter&orientation=landscape&dompdf_ver=trunk&load_method=1&submit=submit

This fix will be included as part of the next release of DOMPDF. If
you're comfortable with Subversion, you can download the latest from
the project repository to get the fix earlier.

INGEDAY

unread,
Dec 10, 2009, 3:43:50 PM12/10/09
to dompdf
Hi BrianS,

I use version 0.6 alpha 2 DOMPDF and I find that error. Please give me
the correct link to download the DOMPDF with you generated the
example. I have a bit of a hurry to correct this error.

The version I downloaded was this link:

http://code.google.com/p/dompdf/downloads/list

The first link des. Zip

Thanks,

On 8 dic, 14:12, BrianS <eclecticg...@gmail.com> wrote:
> I was able to duplicate your problem using DOMPDF 0.6.0 alpha 2. The
> issue has already been addressed in the latest dev version of DOMPDF.
> You can see the improved rendering here:http://eclecticgeek.com/dompdf/index.php?input_file_http=http%3A%2F%2...

Ryan Masten

unread,
Dec 10, 2009, 3:48:36 PM12/10/09
to dom...@googlegroups.com
Per: http://code.google.com/p/dompdf/source/checkout

# Non-members may check out a read-only working copy anonymously over HTTP.
svn checkout http://dompdf.googlecode.com/svn/trunk/ dompdf-read-only


--
Ryan H. Masten
www.ryanmasten.com


--

You received this message because you are subscribed to the Google Groups "dompdf" group.
To post to this group, send email to dom...@googlegroups.com.
To unsubscribe from this group, send email to dompdf+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/dompdf?hl=en.



BrianS

unread,
Dec 11, 2009, 12:00:11 AM12/11/09
to dompdf
I'm using the current development version, for which we don't provide
official downloads. The main reason being that we haven't necessarily
run the full set of test files through this version. If you want to
try it out, the best way to get the latest development version is
through Subversion (our version control system) as has been noted by
Ryan. It has a number of benefits, such as being able to easily switch
the revision you are using.

However, I realize that not everyone is familiar with Subversion. If
you're comfortable trying out the development version you can find the
download at the following URLs:

zip format
http://www.eclecticgeek.com/dompdf/nightly.php?format=zip

tar.gz format
http://www.eclecticgeek.com/dompdf/nightly.php?format=tar.gz

David da Guia Carvalho

unread,
Dec 16, 2009, 8:41:41 AM12/16/09
to dompdf
Hi,

I dont know if i do somethings wrong but I have donwloaded (in side
the dompdf.php i see/* $Id: dompdf.php 201 2009-12-04 04:46:42Z
woody.gilk $ */) from svn and the problem seens not completely
solved... For example a "table row or cell" (tr,th,td) that inherits
backgrond-color from a "css class" dont show its background... but if
u do the same css (background-color) directly in the "tag style" it
works.


On 11 dez, 03:00, BrianS <eclecticg...@gmail.com> wrote:
> I'm using the current development version, for which we don't provide
> official downloads. The main reason being that we haven't necessarily
> run the full set of test files through this version. If you want to
> try it out, the best way to get the latest development version is
> through Subversion (our version control system) as has been noted by
> Ryan. It has a number of benefits, such as being able to easily switch
> the revision you are using.
>
> However, I realize thatnoteveryone is familiar with Subversion. If
> you're comfortable trying out the development version you can find the
> download at the following URLs:
>
> zip formathttp://www.eclecticgeek.com/dompdf/nightly.php?format=zip
>
> tar.gz formathttp://www.eclecticgeek.com/dompdf/nightly.php?format=tar.gz
> > > > >notseeing in the most recent version in the repository. Typically
> > > > > text issues such as the two you listed can be due to missing or
> > > > > incorrect metric information for supported characters.
>
> > > > > Since I'mnotseeing the issue in the current dev version perhaps the

BrianS

unread,
Dec 16, 2009, 2:30:24 PM12/16/09
to dompdf
On Dec 16, 8:41 am, David da Guia Carvalho <dgui...@gmail.com> wrote:
> I dont know if i do somethings wrong but I have donwloaded (in side
> the dompdf.php i see/* $Id: dompdf.php 201 2009-12-04 04:46:42Z
> woody.gilk $ */) from svn and the problem seens not completely
> solved... For example a "table row or cell" (tr,th,td) that inherits
> backgrond-color from a "css class" dont show its background... but if
> u do the same css (background-color) directly in the "tag style" it
> works.

There are a number of unresolved problems with tables. Though I
haven't worked with the code that handles tables much, it's probably
safe to say this is due to an issue with DOMPDF. Quick testing shows
that inheritance isn't quite working as expected. I do get inheritance
from the table to the cell, but not from the row. I also see class
styles applied as expected when the class is on the table or cell
elements.

Regarding your problem, are you saying you apply a class to a table
cell and don't see the style applied? This should work, based on what
I'm seeing initially. Do you have a sample document that exhibits the
problem so I can do further testing?
-b

DGC

unread,
Dec 17, 2009, 5:53:58 AM12/17/09
to dompdf
Hi,

Overall the dompdf is pretty good... the best php lib in this scope
(convert html in pdf) that I ever cross with...
The tables support is fair... I see some problems with "width" and
nest but most of the problems can be dealed with simple html/css
proper usage.

About the cell and row... u are right... the cell did work... but the
row dont...

About the code... the idea is a css class (lets say) .theader
{ background-color: #A9A9A9; }

If u apply it on tr (<tr class='theader'>) the td (with no class or
style <td>) do not inherits from "classed tr" as expected.

Snap of codes:

(Full CSS set)
body {
font-family:Arial;
font-size:10px;
font-size-adjust:none;
font-style:normal;
font-variant:normal;
font-weight:normal;
line-height:normal;
}
.titulo {
font-size:14px;
font-weight: bold;
}
.subtitulo {
font-size:12px;
font-weight: bold;
}
.minititulo {
font-size:8px;
font-weight: bold;
}
.minitexto {
font-size:8px;
}
table {
width: 290mm;
}
.theader {
background-color: #A9A9A9;
border-style: solid;
border-width: 1px;
}

Example of table:

(the 2 lines should have background)

<table style='border-style: solid; border-width: 1px; padding: 0;
border-spacing: 0;'>
<tr class='theader' align='center'>
<td colspan='2' style='border-style: solid; border-width:
1px;'>
1
</td>
<td colspan='2' style='border-style: solid; border-width:
1px;'>
2
</td>
<td colspan='2' style='border-style: solid; border-width:
1px;'>
3
</td>
</tr>
<tr class='theader' align='center'>
<td >
1
</td>
<td >
2
</td>
<td >
3
</td>
<td >
4
</td>
<td >
5
</td>
<td >
6
</td>
</tr>
</table>

BrianS

unread,
Dec 17, 2009, 2:22:52 PM12/17/09
to dompdf
On Dec 17, 5:53 am, DGC <dgui...@gmail.com> wrote:
> About the cell and row... u are right... the cell did work... but the
> row dont...
>
> About the code... the idea is a css class (lets say) .theader
> { background-color: #A9A9A9; }
>
> If u apply it on tr (<tr class='theader'>) the td (with no class or
> style <td>) do not inherits from "classed tr" as expected.

As I would expect based on my testing. We'll look into the problem,
but I'm not sure when. For now you might modify your stylesheet so
that you are forcing the inheritance. This seems to work:

.theader, .theader > td { background-color: #A9A9A9; }

So it's saying apply the background-color to elements with the theader
class AND apply it to TD elements that are direct children of that
element. Good luck.

Reply all
Reply to author
Forward
0 new messages