我正在使用此代码水平对齐.
cell = New PdfPCell(); p = New Phrase("value"); cell.AddElement(p); cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER; //Tried with Element.Align_Center Also. Tried Adding this line before adding element also. table.AddCell(cell);
它不起作用.
解决方法
试试这个,
cell = New PdfPCell(); p = New Phrase("value"); cell.AddElement(p); cell.HorizontalAlignment = Element.ALIGN_CENTER; //Tried with Element.Align_Center Also. Tried Adding this line before adding element also. table.AddCell(cell);