Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我如何将 pdfptable 用作真实表格(A x B)而不仅仅是(A x A)
以这种方式声明它只给我一行:
Dim datatable As PdfPTable = New PdfPTable(4)
我如何声明它以使其具有多行和多列?
您已经用多列声明它。行是自动的。使用当前设置,您将声明一个包含四列的表。现在您需要做的是添加单元格。他们将相加,直到达到您的列数,然后他们将开始新行。
所以:
Dim table As New PdfPTable(4) For i As Integer = 0 To 12 Dim cell As New PdfPCell("cell " & i) table.Add(cell) Next
应该产生一个 3x4 表。