forked from hmkcode/Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStyle.java
More file actions
63 lines (47 loc) · 1.47 KB
/
Style.java
File metadata and controls
63 lines (47 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package com.hmkcode;
import com.itextpdf.text.BaseColor;
import com.itextpdf.text.Element;
import com.itextpdf.text.pdf.PdfPCell;
public class Style {
public static void headerCellStyle(PdfPCell cell){
// alignment
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
// padding
cell.setPaddingTop(0f);
cell.setPaddingBottom(7f);
// background color
cell.setBackgroundColor(new BaseColor(0,121,182));
// border
cell.setBorder(0);
cell.setBorderWidthBottom(2f);
}
public static void labelCellStyle(PdfPCell cell){
// alignment
cell.setHorizontalAlignment(Element.ALIGN_LEFT);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
// padding
cell.setPaddingLeft(3f);
cell.setPaddingTop(0f);
// background color
cell.setBackgroundColor(BaseColor.LIGHT_GRAY);
// border
cell.setBorder(0);
cell.setBorderWidthBottom(1);
cell.setBorderColorBottom(BaseColor.GRAY);
// height
cell.setMinimumHeight(18f);
}
public static void valueCellStyle(PdfPCell cell){
// alignment
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
// padding
cell.setPaddingTop(0f);
cell.setPaddingBottom(5f);
// border
cell.setBorder(0);
cell.setBorderWidthBottom(0.5f);
// height
cell.setMinimumHeight(18f);
}
}