title: Center and bold the contents of table cells in Apache POI Word document
body: <p>How can I center and bold the content of the table cells using Apache POI in a Word document? This is the code I use to build the table:</p>
  <pre><code>XWPFDocument document = new XWPFDocument();
  XWPFTable table = document.createTable();
  
  XWPFTableRow tableRowOne = table.getRow(0);
  tableRowOne.getCell(0).setText(&quot;CUSTOMER_NAME&quot;);
  tableRowOne.addNewTableCell().setText(&quot;Kumar&quot;);
  tableRowOne.addNewTableCell().setText(&quot;CUSTOMER_ID&quot;);
  tableRowOne.addNewTableCell().setText(&quot;123&quot;);
  
  XWPFTableRow tableRowTwo = table.createRow();
  tableRowTwo.getCell(0).setText(&quot;AGE_GENDER&quot;);
  tableRowTwo.getCell(1).setText(&quot;25/M&quot;);
  tableRowTwo.getCell(2).setText(&quot;VISIT_DATE&quot;);
  tableRowTwo.getCell(3).setText(&quot;11/02/2021&quot;);
  
  XWPFTableRow tableRowThree = table.createRow(); 
  tableRowThree.getCell(0).setText(&quot;REFERRED_BY&quot;);
  tableRowThree.getCell(1).setText(&quot;Self&quot;);
  </code></pre>