设置相关外部文件表头行高
This commit is contained in:
parent
2e2849f91c
commit
a648ba62c1
@ -603,7 +603,7 @@ public class OutputWordUtil {
|
|||||||
TableRow row = table.getRows().get(0);
|
TableRow row = table.getRows().get(0);
|
||||||
row.isHeader(true);
|
row.isHeader(true);
|
||||||
row.setHeightType(TableRowHeightType.Exactly);
|
row.setHeightType(TableRowHeightType.Exactly);
|
||||||
row.setHeight(25);
|
row.setHeight(20);
|
||||||
table.setPreferredWidth(new PreferredWidth(WidthType.Twip, (short) 8335f));
|
table.setPreferredWidth(new PreferredWidth(WidthType.Twip, (short) 8335f));
|
||||||
|
|
||||||
float[] columnWidths = {10f,17f,13f,17f,13f,13f,13f,25f};
|
float[] columnWidths = {10f,17f,13f,17f,13f,13f,13f,25f};
|
||||||
@ -633,7 +633,7 @@ public class OutputWordUtil {
|
|||||||
for (int r = 0; r < data.length; r++) {
|
for (int r = 0; r < data.length; r++) {
|
||||||
TableRow dataRow = table.getRows().get(r + 1);
|
TableRow dataRow = table.getRows().get(r + 1);
|
||||||
|
|
||||||
dataRow.setHeight(25);
|
dataRow.setHeight(20);
|
||||||
dataRow.setHeightType(TableRowHeightType.Auto);
|
dataRow.setHeightType(TableRowHeightType.Auto);
|
||||||
dataRow.getRowFormat().setBackColor(Color.white);
|
dataRow.getRowFormat().setBackColor(Color.white);
|
||||||
|
|
||||||
@ -1053,8 +1053,8 @@ public class OutputWordUtil {
|
|||||||
|
|
||||||
TableRow row = table.getRows().get(0);
|
TableRow row = table.getRows().get(0);
|
||||||
row.isHeader(true);
|
row.isHeader(true);
|
||||||
//row.setHeight(20);
|
row.setHeight(20);
|
||||||
row.setHeightType(TableRowHeightType.Auto);
|
row.setHeightType(TableRowHeightType.Exactly);
|
||||||
for (int i = 0; i < header.length; i++) {
|
for (int i = 0; i < header.length; i++) {
|
||||||
row.getCells().get(i).getCellFormat().setVerticalAlignment(VerticalAlignment.Middle);
|
row.getCells().get(i).getCellFormat().setVerticalAlignment(VerticalAlignment.Middle);
|
||||||
Paragraph p = row.getCells().get(i).addParagraph();
|
Paragraph p = row.getCells().get(i).addParagraph();
|
||||||
@ -1076,7 +1076,7 @@ public class OutputWordUtil {
|
|||||||
//将数据添加到其余行
|
//将数据添加到其余行
|
||||||
for (int r = 0; r < data.length; r++) {
|
for (int r = 0; r < data.length; r++) {
|
||||||
TableRow dataRow = table.getRows().get(r + 1);
|
TableRow dataRow = table.getRows().get(r + 1);
|
||||||
//dataRow.setHeight(25);
|
dataRow.setHeight(20);
|
||||||
//dataRow.setHeightType(TableRowHeightType.Auto);
|
//dataRow.setHeightType(TableRowHeightType.Auto);
|
||||||
dataRow.getRowFormat().setBackColor(Color.white);
|
dataRow.getRowFormat().setBackColor(Color.white);
|
||||||
for (int c = 0; c < data[r].length; c++) {
|
for (int c = 0; c < data[r].length; c++) {
|
||||||
@ -1191,8 +1191,8 @@ public class OutputWordUtil {
|
|||||||
|
|
||||||
TableRow row = table.getRows().get(0);
|
TableRow row = table.getRows().get(0);
|
||||||
row.isHeader(true);
|
row.isHeader(true);
|
||||||
//row.setHeight(20);
|
row.setHeight(20);
|
||||||
row.setHeightType(TableRowHeightType.Auto);
|
row.setHeightType(TableRowHeightType.Exactly);
|
||||||
for (int i = 0; i < header.length; i++) {
|
for (int i = 0; i < header.length; i++) {
|
||||||
row.getCells().get(i).getCellFormat().setVerticalAlignment(VerticalAlignment.Middle);
|
row.getCells().get(i).getCellFormat().setVerticalAlignment(VerticalAlignment.Middle);
|
||||||
Paragraph p = row.getCells().get(i).addParagraph();
|
Paragraph p = row.getCells().get(i).addParagraph();
|
||||||
@ -1216,7 +1216,7 @@ public class OutputWordUtil {
|
|||||||
//将数据添加到其余行
|
//将数据添加到其余行
|
||||||
for (int r = 0; r < data.length; r++) {
|
for (int r = 0; r < data.length; r++) {
|
||||||
TableRow dataRow = table.getRows().get(r + 1);
|
TableRow dataRow = table.getRows().get(r + 1);
|
||||||
//dataRow.setHeight(25);
|
dataRow.setHeight(20);
|
||||||
//dataRow.setHeightType(TableRowHeightType.Auto);
|
//dataRow.setHeightType(TableRowHeightType.Auto);
|
||||||
dataRow.getRowFormat().setBackColor(Color.white);
|
dataRow.getRowFormat().setBackColor(Color.white);
|
||||||
for (int c = 0; c < data[r].length; c++) {
|
for (int c = 0; c < data[r].length; c++) {
|
||||||
@ -1339,7 +1339,7 @@ public class OutputWordUtil {
|
|||||||
table.autoFit(AutoFitBehaviorType.Auto_Fit_To_Window);
|
table.autoFit(AutoFitBehaviorType.Auto_Fit_To_Window);
|
||||||
TableRow row = table.getRows().get(0);
|
TableRow row = table.getRows().get(0);
|
||||||
row.isHeader(true);
|
row.isHeader(true);
|
||||||
//row.setHeight(20);
|
row.setHeight(20);
|
||||||
row.setHeightType(TableRowHeightType.Exactly);
|
row.setHeightType(TableRowHeightType.Exactly);
|
||||||
|
|
||||||
|
|
||||||
@ -1370,7 +1370,7 @@ public class OutputWordUtil {
|
|||||||
//将数据添加到其余行
|
//将数据添加到其余行
|
||||||
for (int r = 0; r < data.length; r++) {
|
for (int r = 0; r < data.length; r++) {
|
||||||
TableRow dataRow = table.getRows().get(r + 1);
|
TableRow dataRow = table.getRows().get(r + 1);
|
||||||
//dataRow.setHeight(25);
|
dataRow.setHeight(20);
|
||||||
//dataRow.setHeightType(TableRowHeightType.Exactly);
|
//dataRow.setHeightType(TableRowHeightType.Exactly);
|
||||||
for (int c = 0; c < data[r].length; c++) {
|
for (int c = 0; c < data[r].length; c++) {
|
||||||
TableCell cell = dataRow.getCells().get(c);
|
TableCell cell = dataRow.getCells().get(c);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user