表格内容对齐
示例代码
package test.create.c04;
import iofd.layout.OfdDocument;
import iofd.layout.block.Paragraph;
import iofd.layout.block.Table;
import java.util.ArrayList;
import java.util.List;
import test.create.TestDocUtil;
public class C0408NumberAutoAlignRight {
public static void main(String[] args) throws Throwable {
C0408NumberAutoAlignRight o = new C0408NumberAutoAlignRight();
o.done();
}
private void done() throws Throwable {
String clzName = this.getClass().getSimpleName();
System.out.println(clzName + " begin");
OfdDocument doc = new OfdDocument();
String s = "这是一个表格的示例:涉及数字的,如果没有配置对齐方式,默认水平靠右对齐;其他类型字符串默认靠右排列。";
Paragraph p = new Paragraph();
p.add(s);
doc.add(p);
List head = new ArrayList<>();
head.add("标题一");
head.add("标题二");
head.add("标题三");
head.add("标题四");
head.add("标题五");
List> data = new ArrayList<>();
for(int i = 0; i < 10; i++) {
List