Categories > TinyButStrong general >

Repeating table with a header group?

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Ciaran
Date: 2006-02-03
Time: 11:22

Repeating table with a header group?

Hi,

I'm trying to make a layout like this:
<table class="event">
<thead>
<tr>
<th colspan="2">Header here</th>
</tr>
</thead>

<tbody>
<tr>
  <td>Body records here</td>
</tr>
</tbody>

</table>
I want a new table every time a certain field changes, but I want a header row in the table too - is there any way to do this?
Thanks :)
By: Skrol29
Date: 2006-02-03
Time: 11:28

Re: Repeating table with a header group?

It seems easy. You just have to define the block on the table.
Example :
<table class="event">
  <thead>
    <tr>
      <th colspan="2"> Header here </th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td> [blk.field1;block=table] </td>
    </tr>
  </tbody>
</table>
By: Ciaran
Date: 2006-02-03
Time: 11:30

Re: Repeating table with a header group?

Hi,
Thanks for your reply - unfortunately that won't do what I want.
That would repeat entire table for every record but I want to repeat it only when a certain field changes, like with headergrp=
By: Skrol29
Date: 2006-02-03
Time: 11:33

Re: Repeating table with a header group?

Ok, sorry,

You want table + header for a new value of certain field, and no header for normal other values ?
By: Ciaran
Date: 2006-02-03
Time: 11:38

Re: Repeating table with a header group?

Yes, I want to have a new table for each new value of the field, but I want to have the value as the header for the table.

Of course if I didn't need a new table I could just use headergrp= to make a new row for each field change..
By: Skrol29
Date: 2006-02-03
Time: 11:49

Re: Repeating table with a header group?

What you need is parameter 'parentgrp'. This example should work:
<table class="event">
  <thead>
    <tr>
      <th colspan="2"> [blk.category;block=table;parentgrp=category] </th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td> [blk.field1;block=tr] </td>
    </tr>
  </tbody>
</table>
By: Ciaran
Date: 2006-02-03
Time: 12:01

Re: Repeating table with a header group?

I've been banging my head trying to get parentgrp working for ages and I just realised the version of TBS this site is using is before parentgrp was added! Argh!

Thanks for the help anyway :)