title: saving to .doc file table
body: <p>Is it possible to save some text and values in a doc file and put them in a table inside that doc file ?
  I have like a shopping list with a column for product name,one for quantity and one for price.
  I'm currently using this to save my files to a doc but they are all messy,they can't be aligned(most of the times the product name,quantity and price vary in text lenght) so i figure putting them in a table is a good way to make sure they are arranged nicely.</p>
  
  <p>Or is there a way to format my text,to put them on columns ?
  I hope you understand what i mean,if not,let me know.</p>
  
  <pre><code>File root = android.os.Environment.getExternalStorageDirectory();
  
      File dir = new File(root.getAbsolutePath() + "/InterSRL");
      dir.mkdirs();
      File file = new File(dir, "myData.doc");
  
      try {
          FileOutputStream f = new FileOutputStream(file);
          PrintWriter pw = new PrintWriter(f);
          for (int n = 0; n &lt; allpret.size() - 1; n++) {
              if (cant[n] != Float.toString(0)
                      &amp;&amp; pret[n] != Float.toString(0)) {
                  String myFormat = "%-10s %-10s %-10s%n";
                  pw.println(String.format(myFormat, prod[n], cant[n],
                          pret[n]));
              }
  
          }
          pw.println((String.format("Total: %.2f", totaltest)));
          pw.flush();
          pw.close();
          f.close();
      } catch (FileNotFoundException e) {
          e.printStackTrace();
          Log.i(TAG,
                  "******* File not found. Did you"
                          + " add a WRITE_EXTERNAL_STORAGE permission to the   manifest?");
      } catch (IOException e) {
          e.printStackTrace();
      }
  </code></pre>