PHP Classes

Table Column Width

Recommend this page to a friend!

      MsDoc Generator  >  All threads  >  Table Column Width  >  (Un) Subscribe thread alerts  
Subject:Table Column Width
Summary:How can you set the width of a column in a table
Messages:2
Author:Daniel
Date:2010-02-18 01:06:58
Update:2010-06-25 13:13:32
 

  1. Table Column Width   Reply   Report abuse  
Picture of Daniel Daniel - 2010-02-18 01:06:58
Fristly, this is a very good class and I was very fortunate to come across it! Thank you for developing it!!!

I am using it to create a multi row, 2 column table and would like to know how to set the width of the columns.

My code is like:

$aligns = array('left', 'right');
$valigns = array('middle', 'middle');
$doc->startTable(array('width' => '100%'), 'tableWithoutBorder');
$cols = array();
$cols[0] = $TransInvCommCom;
$cols[1] = $TransInvCommTotVal;
$doc->addTableRow($cols, $aligns, $valigns);
unset($cols);

I would need to set $cols[0]=5.20". How can this be done?

Thank you so much for your help!

  2. Re: Table Column Width   Reply   Report abuse  
Picture of Simona Ilie Simona Ilie - 2010-06-25 13:13:32 - In reply to message 1 from Daniel
Yes indeed...this class is very good.

If you look in the class' code you will see the table column's width is calculated by table_width/total_columns_number (so the columns' width is fixed). I made a small change because I needed various widths. If you want more details private message me.