Apache POI word, how to remove the white space (new line) from beginning of table cell?
<p>I am only able to style the contents of a table cell using paragraph element to change the color of the text for example. 
When i create a paragraph inside the table it creates a new line. For my project i need these cell to be as small as possible for that i am using </p>

<pre><code>   tr.setHeight(300);
   tr.getCtRow().getTrPr().getTrHeightArray(0).setHRule(STHeightRule.EXACT);
</code></pre>

<p>that works when there is no blank lines. </p>

<p>the code below is the problem</p>

<pre><code>    XWPFTable tb = document.createTable(2,2);
    XWPFParagraph p1 =  tb.getRow(0).getCell(0).addParagraph();
    XWPFRun p1run = p1.createRun();
    p1run.setText("why is there a space");
    XWPFParagraph p2 =  tb.getRow(1).getCell(1).addParagraph();
    XWPFRun p2run = p2.createRun();
    p2run.setText("still there ");
</code></pre>

<p>This create this output</p>

<p><a href="http://i.stack.imgur.com/bSONW.png" rel="nofollow">http://i.stack.imgur.com/bSONW.png</a></p>