我尝试了这段代码,但由于某种原因它不起作用..
var table : SimpleTable = new SimpleTable();
table.widthPercentage = 100;
table.borderWidth = 1;
var row : SimpleCell = new SimpleCell( SimpleCell.ROW );
row.border = 1;
row.borderColor = RGBColor.fromARGB( 0x555555 );
row.borderWidth = 1;
row.verticalAlignment = Element.ALIGN_MIDDLE;
var cell1 : SimpleCell = new SimpleCell( SimpleCell.CELL );
cell1.widthpercentage = 25;
cell1.verticalAlignment = Element.ALIGN_MIDDLE;
var p : Paragraph = new Paragraph( 'test', PurePDFGenerator.pdf.cyrillicFont );
p.alignment = Element.ALIGN_MIDDLE;
cell1.add( p );
row.add( cell1 );
table.add( row );
- 如何将段落文本对齐到简单单元格的中间?
最佳答案
在 Paragraph.alignment 起作用之前,您可以使用
cell.horizontalAlignment = Element.ALIGN_CENTER;
关于actionscript-3 - 弹性 : Purepdf : Aligning paragraph text into the middle of a SimpleCell?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9774956/