为什么将垂直对齐设置为中间后对齐仍然是底部?
Why is alignment still bottom after setting vertical alignment to middle?
我有一个要添加单元格的 table。
对于每个单元格,我都设置了垂直对齐方式:
PdfPCell cell = new PdfPCell () { Colspan = 6, VerticalAlignment = Element.ALIGN_MIDDLE };
cell.BackgroundColor = new Color(########);
chunk = new Chunk("Chunk");
cell.AddElement(chunk);
table.AddCell(cell);
但文本 "Chunk" 仍位于单元格底部。我可以在单元格顶部看到空 space。
为什么我的文本不能正确对齐?
我将 Chunks 切换为 Phrases,所以现在我处于文本模式,允许垂直对齐 属性。
PdfPCell cell = new PdfPCell (new Phrase("Chunk")) { Colspan = 6, VerticalAlignment = Element.ALIGN_MIDDLE };
cell.BackgroundColor = new Color(########);
table.AddCell(cell);
我有一个要添加单元格的 table。
对于每个单元格,我都设置了垂直对齐方式:
PdfPCell cell = new PdfPCell () { Colspan = 6, VerticalAlignment = Element.ALIGN_MIDDLE };
cell.BackgroundColor = new Color(########);
chunk = new Chunk("Chunk");
cell.AddElement(chunk);
table.AddCell(cell);
但文本 "Chunk" 仍位于单元格底部。我可以在单元格顶部看到空 space。
为什么我的文本不能正确对齐?
我将 Chunks 切换为 Phrases,所以现在我处于文本模式,允许垂直对齐 属性。
PdfPCell cell = new PdfPCell (new Phrase("Chunk")) { Colspan = 6, VerticalAlignment = Element.ALIGN_MIDDLE };
cell.BackgroundColor = new Color(########);
table.AddCell(cell);