You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "Robinson, Brian L. (Mission Systems)" <Br...@ngc.com> on 2008/06/18 17:06:37 UTC

Tales in Powerpoint

How does one set the position and size of a new table in a powerpoint
slide using POI?  So far I have been able to create a table, set it's
data, number or of rows and columns, font size, and border, but have had
no success setting it's size or location.



Re: Tales in Powerpoint

Posted by Yegor Kozlov <ye...@dinom.ru>.
> How does one set the position and size of a new table in a powerpoint
> slide using POI?  So far I have been able to create a table, set it's
> data, number or of rows and columns, font size, and border, but have had
> no success setting it's size or location.

The width of a table is comprised of the widths of individual columns.
For example, if you have a table with two columns and want to set the widths in proportion 2:1
you can use the following code:

//set width of the 1st column
  table.setColumnWidth(0, 300);
  //set width of the 2nd column
  table.setColumnWidth(1, 150);

Total width is 300+150 = 450px

To position a table in a slide use table.move(x, y)

The following code centers the table :

   int pgWidth = slideShow.getPageSize().width;
   table.moveTo((pgWidth - table.getAnchor().width)/2, 200);

See http://poi.apache.org/hslf/how-to-shapes.html#Tables

Yegor

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org