Forum How do I...?

span inside tables creates margin/padding

pabloxs
Hi,

We are new to Prince, we used to use another tool to convert from HTML to PDF. We create and print invoices, so our clients already have their HTML formats.

In the migration process we have found some things we have to change to our reports to function propertly in PRINCE, and I also have modified the xhtml-ns.css file in order to adjust our outputs.

Some of our reports structure has something like this:
------------------------------------------------------------------------------------------
<table style="text-align: left; width: 629px; height: 90px;">
<tbody>
<tr>
<td style="vertical-align: top; width: 66px; height: 86px;">
<span style="font-size: 9px; font-weight: bold; text-align: center;">CLIENTE:</span>
<span style="font-size: 8px; font-weight: bold; text-align: center;"></span>
</td>
...
------------------------------------------------------------------------------------------
Our problem is that PRINCE adds margin/padding to the span objects so our table is bigger than before.

Can I adjust this "adjustment"? Or how can I workaround this issue?

Thanks a lot.




mikeday
Tables in HTML have border spacing and padding by default, you could try this:
table { border-spacing: 0 }
td { padding: 0 }
pabloxs
When I try something like this, it gets no padding:

------------------------------------------------------------------------------------------
<table style="text-align: left; width: 629px; height: 90px;">
<tbody>
<tr>
<td style="vertical-align: top; width: 66px; height: 86px;">
CLIENTE:
</td>
----------------------------------------------------------------------------

The padding appears when I put a SPAN object inside the td.
mikeday
The span is center aligned, could that be it?

Do you have any other styling rules applying to span elements?