A little coding fun: simple table with resizeable rows and columns

77 views
Skip to first unread message

Charlie Veniot

unread,
Apr 2, 2021, 2:45:41 PM4/2/21
to TiddlyWiki
G'day, I felt like experimenting a little bit, trying to figure out an easy way to create a simple table that allows resizing rows and columns of data.

So a wee TiddlyWiki CSS + HTML itch that needed some scratching.

For yer interest, please find below a screenshot and the related code.

Cheers !

Screenshot 2021-04-02 3.30.27 PM.png

Code:

<$vars rowCount={{{ [[4]]}}}
           colCount={{{ [[5]] }}}>

<table>

<tr>
<th>
</th>
<$list filter="[range<colCount>]">
<th style="padding:0px;border:1px solid black;">
<div style="resize:horizontal;overflow:auto; min-width:1em; min-height:2em;text-align:center;">
 {{!!title}}
</div>
</th>
</$list>
</tr>
<$list filter="[range<rowCount>]">
<$vars currentRow=<<currentTiddler>>>
<tr style="border:1px solid black;">
<th style="padding:0px;border:1px solid black;">
<div style="resize:vertical;overflow:auto;min-width:2em; min-height:1em;text-align:center;">
 <<currentRow>>
</div>
</th>
<$list filter="[range<colCount>]">
<$vars currentCol=<<currentTiddler>>>
<td style="border:1px solid blue;min-height:1em;padding:1px;">
<div style="width:100%; height:100%;overflow:auto;">
<<currentCol>>
</div>
</td>
</$vars>
</$list>
</tr>
</$vars>
</$list>

</table>


</$vars>

Mohammad Rahmani

unread,
Apr 2, 2021, 2:52:46 PM4/2/21
to tiddl...@googlegroups.com
Very nice!

Why not to use just

<$vars rowCount=4
           colCount=5>

Best wishes
Mohammad


--
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 tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/b63eb895-c40b-477f-ad4a-6546611127c6n%40googlegroups.com.

Charlie Veniot

unread,
Apr 2, 2021, 3:37:36 PM4/2/21
to TiddlyWiki
Because my code will eventually be getting those values from a data tiddler.  So my code snapshot was caught midstream between points A and Z.

Same goes for most anything else that seems a little bit odd/overkill.  Well, bound to be some goofiness/slopiness as I'm just in a "get the thing working" mindset ...

"Pretty" code likely for later.

jtech108

unread,
Apr 2, 2021, 4:36:32 PM4/2/21
to TiddlyWiki
Ooooh veeeery interesting indeed! (O_o)


Regards,
Julio

Reply all
Reply to author
Forward
0 new messages