I've forgot to precise:
In my use case, a tiddler is tagged with either "a" or "b", but not with 
both tags a + b.

@cj.v:
Thank you for your code, but i obtain only one row contains tiddlers tagged 
with "a" in the firt column and tiddler tagged with "b" on the second.
However adding <br> after each <$link>, I almost get the expected result :

Tag_a   Tag_b
Tid1_a
        Tid2_b
Tid3_a
Tid4_a
        Tid5_b

This is already a big step forward for me!


@Eric,

Thanks also for your code and notes for my understanding!
When I try it, I only see the table header "a | b" but no rows after that.
Is there a way to debug what is in the "rows" variable ?


Le mercredi 30 mars 2022 à 16:00:04 UTC+2, Eric Shulman a écrit :

> Give this a try:
> ```
> <$set  name="A" filter="[tag[a]!is[system]sort[title]]">
> <$set  name="B" filter="[tag[b]!is[system]sort[title]] -[enlist<A>]">
> <$vars rows={{{ [enlist<A>count[]] [enlist<B>count[]] +[maxall[]] }}}>
> <table>
>    <th>a</th><th>b</th>
>    <$list filter="[range[1],<rows>]" variable=row>
>       <tr>
>          <td><$link to={{{ [enlist<A>nth<row>] }}}/></td>
>          <td><$link to={{{ [enlist<B>nth<row>] }}}/></td>
>       </tr>
>    </$list>
> </table>
> </$vars>
> </$set>
> </$set>
> ```
> Notes:
> * The first two `<$set>` widgets get the two lists of tagged items.  Note 
> how the second list (`B`) excludes any items that are already in list `A`.
> * The `<$vars>` widget finds the length of the longer list, which will be 
> the number of rows in the output table.
> * The `<$list>` widget defines a loop that sets the row number, 1 to N
> * Then, for each row, we output the nth item in each list
>
> enjoy,
> -e
> On Wednesday, March 30, 2022 at 3:00:55 AM UTC-7 [email protected] wrote:
>
>> Hi,
>>
>> I am stuck on a basic question and would like to know your point of view.
>>
>> What would be your approach to create an html table with two columns, the 
>> first to list all tiddlers labelled with "a" and the second to list all 
>> tiddlers labelled with "b", but that each tidler only appears once and is 
>> not duplicated?
>>
>> I started with this code but evidently it doesn't work as I would like. 
>> If i have two tiddlers tagged with "a" and a tidller tagged with "b",  the 
>> tiddler tagged with "b" so appears on the first and on the second row.
>>
>> ```
>> <table>
>> <th >Tag_a</th><th >Tag_b</th>
>> <$list filter="[!is[system]tag[a]sort[title]]" variable="taga">
>> <$list filter="[!is[system]tag[b]sort[title]]" variable="tagb">
>> <tr>
>> <td><$link to=<<taga></$link></td><td><$link to=<tagb></$link></td>
>> </tr>
>> </$list>
>> </$list>
>> </table>
>> ```
>> Any help would be appreciated, thank you !
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/75754c96-2e98-4790-9d7d-3dabad647307n%40googlegroups.com.

Reply via email to