我有个桌子我要给它加个单元格。
对于每个单元格,我设置垂直对齐方式如下:
PdfPCell cell = new PdfPCell () { Colspan = 6, VerticalAlignment = Element.ALIGN_MIDDLE };
cell.BackgroundColor = new Color(########);
chunk = new Chunk("Chunk");
cell.AddElement(chunk);
table.AddCell(cell);但是文本“块”仍然位于单元格的底部。我能看到牢房顶部的空隙。
为什么我的文字不对齐?
发布于 2016-02-23 21:52:34
我把分块换成了短语,所以现在我处于文本模式,这允许垂直对齐属性。
PdfPCell cell = new PdfPCell (new Phrase("Chunk")) { Colspan = 6, VerticalAlignment = Element.ALIGN_MIDDLE };
cell.BackgroundColor = new Color(########);
table.AddCell(cell);https://stackoverflow.com/questions/35587815
复制相似问题