user issue: style table #24

Open
Elexy opened this Issue Mar 20, 2013 · 3 comments

Comments

Projects
None yet
2 participants

Elexy commented Mar 20, 2013

I am trying to padd table cells like this, but get: Unknown tag "td" in stylesheet section.
500 Internal Server Error - ParseException
Can anybody lend hand here? thanks in advance.

  <dynamic-page>
    <h1>Report</h1>
    <table>
      <stylesheet>
        <td padding="2px" />
        <complex-attribute name="background" color="Silver" />
      </stylesheet>
      <tr>
        <td>Id : {{ report.id }}</td>
        <td>Latitude: {{ report.lat }}</td>
      </tr>
      <tr>
        <td>Date: {{ "now"|date("m/d/Y") }}</td>
        <td>Longitude: {{ report.lon }}</td>
      </tr>
    </table>
    <p>

    </p>
  </dynamic-page>
</pdf>```
Owner

psliwa commented Mar 20, 2013

Please use separate stylesheet file (https://github.com/psliwa/PHPPdf#stylesheet) instead inline styles. Inline tag works in different way. In your example styles apply on table tag, you can't define styles for children tag from inline styles.

Elexy commented Mar 20, 2013

Thanks, how do I include the external stylesheet when I use the Symfony2 bundle with twig?

Owner

psliwa commented Mar 20, 2013

Pdf annotation has stylesheet attribute, check this example: https://github.com/psliwa/PdfBundle/blob/master/Controller/ExampleController.php#L44. Example of stylesheet document syntax you can find in documentation: https://github.com/psliwa/PHPPdf#stylesheet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment