0

I have a questionnaire form like this: questionnaires form  just like  this

The current implementation is to use LinearLayout ,TextView and EditText little by little layout to achieve. Very curious about those Excel App in Android,how their layout is achieved? Please give me some hints and inspiration。Thanks in advance.

Mark Fitzgerald
  • 3,048
  • 3
  • 24
  • 29
Sun
  • 21
  • 4

1 Answers1

0

I think the easiest way would be to create table using HTML and load that HTML into WebView. Here's simple example:

WebView mWebView = (WebView) findViewById(R.id.myWebView);

String myHtmlString = "<html><body>" +
                "<h2>This is a HTML Heading in Android WebView.</h2>\n" +
                "<p>This is a HTML paragraph in android WebView.</p>\n" +
                "\n" +
                "<h4>Following is HTML Table in WebView</h4>\n" +
                "<table border=\"1\" width=\"100%\">\n" +
                "  <tr>\n" +
                "    <td>Android</td>\n" +
                "    <td>WebView</td>\t\t\n" +
                "    <td>100</td>\n" +
                "  </tr>\n" +
                "  <tr>\n" +
                "    <td>Android</td>\n" +
                "    <td>WebView</td>\t\t\n" +
                "    <td>200</td>\n" +
                "  </tr>\n" +
                "  <tr>\n" +
                "    <td>Android</td>\n" +
                "    <td>WebView</td>\t\t\n" +
                "    <td>300</td>\n" +
                "  </tr>\n" +
                "</table>" +
                "</body></html>";

mWebView.loadData(myHtmlString, "text/html", null);
SpiralDev
  • 7,011
  • 5
  • 28
  • 42