1

Lets'say I've got a page

<apex:page renderAs="pdf" applyBodyTag="false" applyHtmlTag="false" showHeader="false">
<header>
    <style>
        .testTable {
            border-spacing: 50px 1px;
            border : 1px solid red;
        }
        .testTr  td {
            width: 50%;
            text-align: center;
            vertical-align: bottom;
            border: 1px solid red;
        }
     </style>
</header>
<body>
    <table class="testTable">
        <tbody>
            <tr class="testTr">
                <td>1345677</td>
                <td>2</td>
            </tr>
            <tr>
                <td>3</td>
                <td>4</td>
            </tr>
        </tbody>
    </table>
</body>

But I've got in my opinion strange result Result What am I doing wrong?

9
  • 6
    you have to use <head> instead of <header> – rael_kid Jan 29 '20 at 14:01
  • 2
    @PhilW Not true, you just have to do it right. – sfdcfox Jan 29 '20 at 14:11
  • 5
    @PhilW There's ... no documentation I'm aware of. A lot of what we've discovered came from exploring the documentation for Flying Saucer. For example, we know that CSS2 is only partially supported, and CSS3 isn't at all. So basically you have to write your pages like it's 1996 (or so). A perfectly well-formed HTML document will apply the CSS correctly. If you have a specific example you'd like fixed, you could ask a question, I'd be glad to point you in the right direction. – sfdcfox Jan 29 '20 at 14:19
  • 1
    In my case - it was my mistake with <head>. Css works fine – pincet Jan 29 '20 at 14:23
  • 2
    @sfdcfox thanks for the info. Useful to know. Now I am aware it is partial CSS2 I can probably work out what the gaps were and work around them without "style" attributes. Great learning! Cheers. – Phil W Jan 29 '20 at 14:53
1

You have to use <head> instead of <header>.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.