Hello Guillaume

In such cases, I would suggest using a table (without or without cell borders).

You would use one row per sub-array in $data.

For a very similar example to what you are trying to achieve, please
take a look at http://is.gd/bgCNi, section "Assigning compound data
types in LiveDocx".

You can specify the decimal tab in your template, and all the decimal
points will line up on top of each other.

Best regards

Jonathan Maron



On Tue, Apr 6, 2010 at 4:53 PM, Guillaume ORIOL <[email protected]> wrote:
> Hi,
>
> I am working on LiveDocx document generation.
> When dealing with arrays, it is sometimes necessary to format the data to be
> printed.
> For instance, consider this data:
>
> $data = array(
>  0 => array(
>    'title' => 'item 1',
>    'width' => 65.00,
>    'height' => 54.00,
>    'purchase_price' => 29.95
>  ),
>  ...
> );
>
> I would like to print it this way:
> title   dim. W x H    price
> -------------------------------------
> item 1  65 x 54 cm    29,95
>
> The width and height should be converted to integer and the decimal
> separator should accomodate to locale.
>
> What is the best practice to do it?
>
> Best regards
> --
> Guillaume ORIOL
> Software engineer
> Technema
>

Reply via email to