0

I want to display a table in email body. The code is as below.

     stringBuilder.append("<html>" +
                            "<body>"+
                            "<table border=\"1\">"+
                            "<tr>"+
                              "<th>Name</th>"+
                              "<th>Telephone</th>"+
                              "<th>Telephone</th>"+
                            "</tr>"+
                            "<tr>"+
                              "<td>Bill Gates</td>"+
                              "<td>555 77 854</td>"+
                              "<td>555 77 855</td>"+
                            "</tr>"+
                            "</table>"+
                            "</body>"+
                            "</html>");

    final Intent intent = new Intent(android.content.Intent.ACTION_SEND);
    intent.setType("text/html");
    intent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Checklist Information");
    intent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(stringBuilder.toString()));

But the table is not showing, rather a simple text is showing in mail body.

Please help me out.

Debarati
  • 3,296
  • 2
  • 18
  • 30

1 Answers1

3

the table html tag is not supported by Html.fromHtml(). See here

Blackbelt
  • 156,034
  • 29
  • 297
  • 305
  • Then how should i display a table in email body. Its my requirement. – Debarati Mar 15 '12 at 11:52
  • take a look here.. http://stackoverflow.com/questions/7787171/sending-html-email-in-android-using-table-etc-is-there-really-no-relativel – Blackbelt Mar 15 '12 at 11:54