Kri*_*s-I 3 c# reporting itextsharp
我有一张桌子,这张桌子有3列.在每列中,都有一张类似于图片的表格.我做了一个生成表的方法,这个方法在参数中接收一个列表并在其上循环以将addCell添加到表中
我想一条线有一个而不是5列...... 1 + 1(colspan of 4).当我做一个colspan时,第一个被合并,我想合并4最后并保持第一个.
我怎样才能做到这一点 ?
谢谢,

Chr*_*aas 10
您只需按照希望它们跨越的顺序将单元格添加到表中.如果您在第一个单元格之前添加跨区单元格,那么它们将如何显示.
PdfPTable t = new PdfPTable(5);
//Row 1
t.AddCell("R1C1");
t.AddCell("R1C2");
t.AddCell("R1C3");
t.AddCell("R1C4");
t.AddCell("R1C5");
//Row 2 - One regular cell followed by four spanned cells
t.AddCell("R2C1");
t.AddCell(new PdfPCell(new Phrase("R2C2-5")) { Colspan = 4 });
//Row 3 - Four spanned cells followed by one regular cell
t.AddCell(new PdfPCell(new Phrase("R3C1-4")) { Colspan = 4 });
t.AddCell("R3C5");
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
12893 次 |
| 最近记录: |