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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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