Formatting results on label or text field

I am fetching data from external DB. The problem is the data text alignment in a label or text field (see pic).
I have tried to format the output in the PHP script which retrieves the data by adding spaces to fill the gap between data and empty field, but no good (E,g: str_repeat(“nbsp;”,(30-strlen($row[“name”]))).
As a label field type in AI2 editor accepts HTML format, I have tried to add HTML code to the PHP script in order to generate a table view in the output but table formatting does not seem to work. Other HTML formatting (e.g. colors, fonts) work for sure.

I would be thankful for any hints regarding output formatting. Also hints regarding HTML tables usability in AI2 are welcome (see

Amongst other HTML it appears to not understand ^table^ and its associated html
^font color="#FF0000^ and ^br^ works at least
(Using br to replace a comma in csv text)

APP INVENTOR needs to explicitly list the HTML it can understand
(Had to replace all “grtr than” and “less than” with ^)

@ewpatton it seems to be, the possible html tags somehow got removed in one of the latest versions of the documentation? Once we had these sentences in the documentaiton of the notifier

The messages in the dialogs (but not the alert) can be formatted using the following HTML tags: <b>, <big>, <blockquote>, <br>, <cite>, <dfn>, <div>, <em>, <small>, <strong>, <sub>, <sup>, <tt>, <u>. You can also use the font tag to specify color, for example, <font color="blue">. Some of the available color names are aqua, black, blue, fuchsia, green, grey, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow.

if you switch to preformatted text you can add them... <br>
just mark your text you like to format and press Ctrl-Shift-C


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

I tried using <font color=red>smthg</font> for text in label and its not working, but the same format works for text in notifiers, any idea how to do it ?

Your code is wrong, you have to make it like this :
<font color="red">Hello Word</font>

Or You Can Also Use Hex Color Like This :
<font color=#FF0000>Hello Salman Developer</font>

So the problem is in your code, the problem is you didn't add "quotes"
because if you are use "COLOR NAME" you must add double quotes, but if you
using (Hex Color) You don't need to add double quotes.

Salman Dev

Hi @Salman_Dev , I had tried every possible combination , with quotes , with Hex colours and none of them seem to be working for labels. Here are some things that worked and that didn't:

In notifiers title connector: nothing worked
In notifiers msg connector: "red" , "Red" , "RED" , red , Red , RED , #FF0000 works (all of 'em)
In label 's text connector : nothing works


In Designer. your Label. Properties. Check HTMLFormat

Is It, You Try it in the (AI Companion)
is this you make it as apk or not

@Juan_Antonio text formatting in labels work fine sir ! thanks a lot ! is there something that can be done for notifier titles ?
not a fan of such formatting..! just curious ! :smiley:

yes , I'm using AI companion

is it successful

I don't think it's possible to format the dialog titles

@Salman_Dev whatever i want to format is looking good , in the process of trying out different things, i tried to change the title of notifiers, which is not working, some to bother about.. as always !!! :stuck_out_tongue:

1 Like

@Salman_Dev oh...okay!!

You could always make your own notifier, using arrangements, labels and a dialog extension like:

1 Like