0

trying to display this html table enter image description here

in android app .this image is just a scap.it contains lot of data .here is html structure enter image description here based on this structure i want to display above table in android app i tried by placing all dt tags static and displaying dd tags with following code

String[] ddsTexts = new String[dds.size()];
            List l = new ArrayList();
            for (int i = 0; i < dds.size(); i++) {
                ddsTexts[i] = dds.get(i).ownText();
                System.out.println(ddsTexts);
                l.add(ddsTexts[i]);
            }

.but it is not working if table format is changing .irrespective of table content ,i want to display it on android screen based on structure.how can i do it.thanks

1 Answer 1

1

The direct answer to your question: You cannot use HTML tables outside of WebViews. In general, HTML doesn't belong in an Android app outside of WebViews and some limited formatting (e.g. <strong> or <em> tags) in TextViews.

The problem with your provided code: You are using System.out.println to try to output the HTML. This simply logs the line to the logcat (and not in a standard way either). Android relies on layouts and Views to present the user interface.

If you don't want to use a WebView, the most appropriate method of displaying a table would be to parse the data and display it in a TableLayout.

Sign up to request clarification or add additional context in comments.

1 Comment

Okay i am using table layout Intent i = new Intent(MainActivity.this, ResultActivity.class); i.putExtra("ddss", ddsTexts); in table second column displaying that ddtexts one by one

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.