Forum


Replies: 1   Views: 2662
Add border, margin and padding for addformelement textbox field
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by peterdan  · 31-05-2017 - 01:48

Hi,

Im trying to add border and padding to a textfield element through addFormElement but im having hard time getting it to work.

Can you give me example to give it a border and padding to the form?

this is my code  as of now..but its not giving it a border.

$docx = new CreateDocx();

$text = array();
$text[] = array('text' => 'x =');

$frag = new WordFragment($docx);

$textFieldOptions = array(
                                'border'=>'single',
                                'borderColor'=>'000000'
                            );
    $frag->addFormElement('textfield', $textFieldOptions);
    $text[] = $frag;
    $text[] = array('text' => 'two');
    $docx->addText($text, $options);

btw, i have the premium version in case you want to know.