Menu

Create one empty line between two tables

PhpRtf
2011-06-30
2013-04-30
  • Martin Preishuber

    Hi,

    What is the proper way to create _one_ empty line between two tables? I do have a section, add two tables with

    $tab1 = $section->addTable();
    // fill my table here
    $tab2 = $section ->addTable();
    // fill second table here

    in the resulting files, those two tables are directly one after another. I tried to add one single empty line in between with

    $section->addEmptyParagraph();

    or

    $section->writeText("");

    both variants result in _two_ new lines in the resulting rtf document .. is there a way to have just one newline char?

    best regards,

    Martin

     
  • Steffen Zeidler

    Steffen Zeidler - 2011-07-18

    Hi Martin,

    It is not that easy, yet.
    I fixed that in trunk and branch 1.1. I will release a new version 1.1.1 around the weekend, I think.

    To add a line break between two tables proper way will be for 1.1.1:

    $tab1 = $section->addTable();
    // fill my table here

    $tab2 = $section ->addTable();
    // fill second table here

    If you do not want a line break between two tables, this is how you could do it:

    $tab1 = $section->addTable();
    // fill my table here
    $tab1->preventEmptyParagraph();

    $tab2 = $section ->addTable();
    // fill second table here

    Hope this will help.

    Best regards,
    SigmaZ

     

Log in to post a comment.