Categories > TinyButStrong general >

One more question about table

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Andrew4fr
Date: 2006-01-09
Time: 18:52

One more question about table

I have a table (for example http://www.photonews.ru/techp3761.htm)
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td rowspan="3">Category</td>
    <td>SubCat1</td>
    <td>1</td>
  </tr>
  <tr>
    <td>SubCat2</td>
    <td>2</td>
  </tr>
  <tr>
    <td>SubCat3</td>
    <td>3</td>
  </tr>
   <tr>
    <td rowspan="2">Category2</td>
    <td>SubCat1</td>
    <td>1</td>
  </tr>
  <tr>
    <td>SubCat2</td>
    <td>2</td>
  </tr>
</table>
A data
$TBS->MergeBlock('tthcat',$GLOBALS['db_connection'],'SELECT * FROM pbn_tth_cat ORDER BY tth_cat_id ASC');
$TBS->MergeBlock('tthsubcat',$GLOBALS['db_connection'],'SELECT * FROM pbn_camera_tth as cam ,pbn_tth_subcat as sub WHERE cam.subcat_id=sub.tth_subcat_id AND camera_id='.$_GET['camera'].' AND (tth_cat_id=%p1%)');
Which template i need write to produce this table from this data?
By: Skrol29
Date: 2006-01-09
Time: 19:17

Re: One more question about table

This should work (not tested) :
<table>
  <tr>
    <td rowspan="[tthcat.#]"> [tthcat.caption;block=tr] </td>
    <td> [tthsubcat.caption;block=tr;extend=1;p1=[tthcat.tth_cat_id]] </td>
    <td> [tthsubcat.num] </td>
  </tr>
</table>
By: Andrew4fr
Date: 2006-01-09
Time: 19:30

Re: One more question about table

Thanks a lot! I forgot about ".#"
By: Skrol29
Date: 2006-01-09
Time: 19:43

Re: One more question about table

Sorry, my snippet is not good.
It a bit more complicated. Can't you use embedded tables instead of rowspan?
By: Andrew4fr
Date: 2006-01-09
Time: 20:08

Re: One more question about table

If not exist simple solution for this, I will use embedded table
By: Skrol29
Date: 2006-01-10
Time: 13:07

Re: One more question about table

I have someting that build all correctly, except <tr rowspan="...">
I can't find a simple way to put the correct value in there.