php - FPDF align text LEFT, Center and Right -


i've have 3 cells , i'am trying align text left, center , right.

function footer()  {      $this->sety( -15 );        $this->setfont( 'arial', '', 10 );       $this->cell(0,10,'left text',0,0,'l');      $this->cell(0,10,'center text:',0,0,'c');      $this->cell( 0, 10, 'right text', 0, 0, 'r' );  }  

when ouput pdf file, center text automatically aligned right. how looks:

enter image description here

can tell me i'm doing wrong here , how can fix issue?

the new position after cell call set right of each cell if set ln-parameter of cell method 0. have reset x-coordinate before last 2 cell calls:

function footer()  {      $this->sety( -15 );       $this->setfont( 'arial', '', 10 );       $this->cell(0,10,'left text',0,0,'l');     $this->setx($this->lmargin);     $this->cell(0,10,'center text:',0,0,'c');     $this->setx($this->lmargin);     $this->cell( 0, 10, 'right text', 0, 0, 'r' );  }  

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -