Am trying to format a .pdf report as a zebra striped output.
I have now a myfile_pdf_attachment.php with the code as follows.
The issue is the background-color doesn't work. Can you advise how I should proceed.
Many thanks.
<style>
table,
th,
td {
border: 1px solid black;
border-collapse: collapse;
padding: 5px;
}
tr:nth-child(odd) {
background-color: #f2f2f2; <!-- doesn't work -->
}
</style>
<table width="100%">
<?php
if (count($xmldata)){
foreach ($xmldata as $data) {
?>
<tr style="height:8px";>
<td style="width:50% ">
<font size="12"><strong><?php echo wordwrap(htmlentities($data[_FF_DATA_TITLE], ENT_QUOTES, 'UTF-8'),50); ?>:</strong></font></style>
</td>
<td style="width:48%">
<strong><font size="12"><?php echo $data[_FF_DATA_TYPE] == 'Signature' && file_exists(JPATH_SITE.'/media/breezingforms/signatures/'.$data[_FF_DATA_VALUE]) ? '<img src="'.JPATH_SITE.'/media/breezingforms/signatures/'.$data[_FF_DATA_VALUE].'" />' : htmlentities(substr(is_array($data[_FF_DATA_VALUE]) ? implode('|',$data[_FF_DATA_VALUE]) : $data[_FF_DATA_VALUE],0,10000), ENT_QUOTES, 'UTF-8'); ?></font></strong>
</style>
</td>
</tr></style>
<?php