Menu

Left and right cell border not showing

PhpRtf
borutt
2011-07-23
2013-04-30
  • borutt

    borutt - 2011-07-23

    Hello,

    I try to set left and right cell border in the table with no luck. Only bottom and top borders are drawn. Here is the code how I did it:
    $border = new PHPRtfLite_Border(
    $rtf,                                       // PHPRtfLite instance
    new PHPRtfLite_Border_Format(0.5, '#000000'), // left border: 2pt, green color
    new PHPRtfLite_Border_Format(0.1, '#000000'), // top border: 1pt, yellow color
    new PHPRtfLite_Border_Format(0.5, '#000000'), // right border: 2pt, red color
    new PHPRtfLite_Border_Format(0, '#000000')  // bottom border: 1pt, blue color
    );

    What do I do wrong ?

    Thanks
    Borut

     
  • Steffen Zeidler

    Steffen Zeidler - 2011-07-27

    Hi Borut,

    In your example code, you are using black color for left, right, top and bottom border. Furthermore your bottom border size is set to zero, which means no bottom border.

    Your example should look like this:

    $border = new PHPRtfLite_Border(
        $rtf, // PHPRtfLite instance
        new PHPRtfLite_Border_Format(0.5, '#00FF00'), // left border: 2pt, green color
        new PHPRtfLite_Border_Format(0.1, '#FFFF00'), // top border: 1pt, yellow color
        new PHPRtfLite_Border_Format(0.5, '#FF0000'), // right border: 2pt, red color
        new PHPRtfLite_Border_Format(0.1, '#0000FF') // bottom border: 1pt, blue color
    );
    $cell = $table->getCell(5, 1)->setBorder($border);

    This workes for me on Microsoft Word 2003.

    Which RTF reader do you use?

    SigmaZ

     

Log in to post a comment.