tags:

views:

30

answers:

1

I am exporting html to pdf and using the thead and tfoot properties of a table to create page headers and footers in my pdf output. It works pretty well except that I need an image at the top left of every page. Using position:absolute as a tag on the image works in html, but unfortunately is ignored by the 3rd-party pdf exporter. This pushes all my text down by the height of the image, instead of sitting nicely beside it. Is there any way to do it using some other method in css? Here is some of the code:

<table>
   <thead>
      <tr>
         <td><img src="mypic.jpg" style="height:150px; width:50px;" alt="pic" /></td>
         <td>&nbsp;</td>
      <tr>
   </thead>
   <tfoot>
      <tr>
         <td colspan="2" style="border-bottom-style:solid; padding-top:10px">blah blah blah</td>
         <td colspan="2" align="right">todays date</td>
      </tr>
   </tfoot>
   <colgroup><col width="50px" /><col width="500px" /></colgroup>
   <tbody>
      <tr>
         <td>&nbsp;</td>
         <td>
             ....my real content...
         </td>
      </tr>
   </tbody>
</table>
A: 

Try this -
The important thing here is align left on the image tag and the image is moved into the content row.

<table>
    <tfoot>
        <tr>
            <td colspan="2" style="border-bottom-style: solid; padding-top: 10px;">
                blah blah blah
            </td>
            <td colspan="2" align="right">
                todays date
            </td>
        </tr>
    </tfoot>
    <colgroup>
        <col width="50px">
        <col width="500px">
    </colgroup>
    <tbody>
        <tr>
            <td>
                &nbsp;
            </td>
            <td>
                <div>
                    <img src="mypic.jpg" style="height: 150px; width: 50px;" alt="pic" align="left"><p>
                        this is some contentthis is some contentthis is some contentthis is some contentthis
                        is some contentthis is some contentthis is some contentthis is some contentthis
                        is some content this is some contentthis is some contentthis is some contentthis
                        is some contentthis is some contentthis is some contentthis is some contentthis
                        is some contentthis is some content this is some contentthis is some contentthis
                        is some contentthis is some contentthis is some contentthis is some contentthis
                        is some contentthis is some contentthis is some content this is some contentthis
                        is some contentthis is some contentthis is some contentthis is some contentthis
                        is some contentthis is some contentthis is some contentthis is some content this
                        is some contentthis is some contentthis is some contentthis is some contentthis
                        is some contentthis is some contentthis is some content</p>
                </div>
            </td>
        </tr>
    </tbody>
</table>
Vinay B R
I need the image exported to every page, so it needs to be in the header.
JumpingJezza