本文将介绍如何使用Spire.Presentation for Java平均分布PowerPoint表格的行和列。
原文档:

import com.spire.presentation.FileFormat;
import com.spire.presentation.ISlide;
import com.spire.presentation.ITable;
import com.spire.presentation.Presentation;
public class DistributeRowsAndColumns {
    public static void main(String []args) throws Exception {
        //创建Presentation实例
        Presentation ppt = new Presentation();
        //加载PowerPoint文档
        ppt.loadFromFile("Input.pptx");
        //获取第一张幻灯片
        ISlide slide = ppt.getSlides().get(0);
        //获取表格
        ITable table = (ITable) slide.getShapes().get(0);
        //平均分布表格行
        table.distributeRows(0,4);
        //平均分布表格列
        table.distributeColumns(0,4);
        //保存结果文档
        ppt.saveToFile("DistributeRowsAndColumns.pptx", FileFormat.PPTX_2013);
    }
}结果文档:

 



 
					



