On Wednesday, June 10, 2020 at 2:53:34 AM UTC-7, Sjaak Adriaanse wrote:
>
> Small question. How can I right-align the input in an edit-text widget ? I 
> use it in a table and I want to input a number so it right-aligns with the 
> numbers above and below. The other numbers are partly calculated from the 
> input in that row and I can right-align those with a space right after the 
> pipe symbol in the Wikitext.
>

Some widgets support direct use of a style="..." parameter for specifying 
CSS attributes to be applied to individual instances of the widget.

Unfortunately, $edit-text does not support use of style="...".  It *does*, 
however, support use of a class="..." parameter.

To get the contents of an $edit-text widget to be right aligned:

1) Define a CSS class (e.g., "right"), by creating a tiddler, tagged with 
$:/tags/Stylesheet, containing
.right { text-align:right; }

2) Then, in the desired $edit-text widget, add a "class" parameter, like 
this:
<$edit-text tag="input" class="right" tiddler="$:/temp/test" 
placeholder="this is a test" default="" />

Note that the ".right" CSS class is also generally useful in other places.
For example, if you simply want some text to be displayed right aligned,
you can enter this in any tiddler:
@@.right
This text is right aligned
@@

and, if you want *all* cells in a table to be right aligned, you can enter 
this:
|right|k
|something|foo|bar|
|baz|mumble|frotz|
|gronk|snork|snerfle|
The initial table row, ending with the "k" suffix, applies the specified 
class(es) to the contents of the entire table

enjoy,
-e


-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/2c70278a-9753-4c77-a24b-76db77ddc076o%40googlegroups.com.

Reply via email to