Adjusting TextView Text Position using HTML



My application has a TextView that allows users to set text using HTML from the settings. However, the TextView does not support the ‘table’ tag or CSS. I am unsure how to position the text using other HTML tags. Is there a tag or HTML.TagHandler that can be used to set the position? If so, how can it be implemented?

Two examples:

  1. I am looking to apply the HTML attribute “align=center” to a single line in a TextView.

  2. My goal is to divide the text into either two or three columns.

How can I do that?

Solution 1:

It appears that you need a WYSIWYG editor such as TinyMCE or CKEditor. Using these editors, you can align text and create tables to divide content into columns.

Solution 2:

In order to align text, the line must be identified by its id or class. If this information is not available, one can consider utilizing jQuery to locate the desired line and align the text within it.

If the text is divided into paragraphs, you can utilize jQuery to locate the specific paragraph you need.

Dividing text into columns can be challenging. If I receive text dynamically from a database using Javascript and CSS, what is the best way to accomplish this task?

Solution 3:

You can try

<div align="center">Your line here</div>


Have a look at the following article that lists all the HTML tags that are supported.

Frequently Asked Questions