Categories > TinyButStrong general >

Merge Table with column instead of rows

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Peter
Date: 2015-07-22
Time: 10:18

Merge Table with column instead of rows

i need an table with merging cols instead of rows, but if i work with parallel it doesn't seem to work. What is wrong in my code?

The Array:

array('name'=>'name1 for col1' ,'price'=>20.1,'price2'=>20.1),
array('name'=>'name2 for col2','price'=>22.1,'price2'=>23.1),
array('name'=>'name3 for col3','price'=>21.1,'price2'=>24.1)

The Template:

        <td class="lighter">Price</td>
        <td class="lighter">[list.price;noerr]</td>
        <td class="dark">Price2</td>
        <td class="dark">[list.price2;noerr]</td>
        <td class="dark">Order</td>
By: Skrol29
Date: 2015-07-30
Time: 11:00

Re: Merge Table with column instead of rows

Hi Peter,

This is because of tags <thead> and <tbody>.

TBS 3.9.0 does not support them yet.

So you have to delete them from the template or to redefine the « tbs:table » configuration with the following code :
$conf = array(
    'parent' => 'table',
    'ignore' => array('!--', 'caption', 'thead', 'thbody', 'thfoot', 'thead', 'tbody'),
    'cols' => array(),
    'rows' => array('tr'),
    'cells' => array('td'=>'colspan', 'th'=>'colspan'),
$TBS->SetOption('parallel_conf', 'tbs:table', $conf);