Package org.apache.poi.hslf.model

Examples of org.apache.poi.hslf.model.TableCell


   private void extractTableText(XHTMLContentHandler xhtml, Table shape) throws SAXException {
      xhtml.startElement("table");
      for (int row = 0; row < shape.getNumberOfRows(); row++){
         xhtml.startElement("tr");
         for (int col = 0; col < shape.getNumberOfColumns(); col++){
            TableCell cell = shape.getCell(row, col);
            //insert empty string for empty cell if cell is null
            String txt = "";
            if (cell != null){
               txt = cell.getText();
            }
            xhtml.element("td", txt);
         }
         xhtml.endElement("tr");
      }
View Full Code Here


    Table table = new Table(5, 2);
    for (int i = 0; i < data.length; i++)
    {
      for (int j = 0; j < data[i].length; j++)
      {
        TableCell cell = table.getCell(i, j);
        cell.setText(data[i][j]);
   
        RichTextRun rt = cell.getTextRun().getRichTextRuns()[0];
        rt.setFontName("Arial");
        rt.setFontSize(10);
   
        cell.setVerticalAlignment(TextBox.AnchorMiddle);
        cell.setHorizontalAlignment(TextBox.AlignCenter);
      }
    }
   
    // set table borders
    Line border = table.createBorder();
View Full Code Here

TOP

Related Classes of org.apache.poi.hslf.model.TableCell

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.