|
|
@ -350,12 +350,14 @@ public class PdfPTable implements LargeElement { |
|
|
|
return; |
|
|
|
return; |
|
|
|
float total = 0; |
|
|
|
float total = 0; |
|
|
|
int numCols = getNumberOfColumns(); |
|
|
|
int numCols = getNumberOfColumns(); |
|
|
|
float cellSpacings = tableProperties.isCollapse() ? 0 : tableProperties.getCellspacing(); |
|
|
|
BorderStyle borderStyle = tableProperties.getBorderStyle(); |
|
|
|
float borderWidth = tableProperties.getBorderStyle().getBorderWidth(); |
|
|
|
float borderWidth = tableProperties.isCollapse() ? borderStyle.getBorderWidth() / 2 : borderStyle.getBorderWidth(); |
|
|
|
|
|
|
|
float cellspacing = tableProperties.getCellspacing(); |
|
|
|
|
|
|
|
float cellpadding = tableProperties.getCellpadding(); |
|
|
|
for (int k = 0; k < numCols; ++k) |
|
|
|
for (int k = 0; k < numCols; ++k) |
|
|
|
total += relativeWidths[k]; |
|
|
|
total += relativeWidths[k]; |
|
|
|
for (int k = 0; k < numCols; ++k) |
|
|
|
for (int k = 0; k < numCols; ++k) |
|
|
|
absoluteWidths[k] = (totalWidth-(cellSpacings+ borderWidth)*(numCols+1)) * relativeWidths[k] / total; |
|
|
|
absoluteWidths[k] = (totalWidth - cellspacing * (numCols + 1) - numCols * 2 * (borderWidth + cellpadding) - 2 * borderWidth) * relativeWidths[k] / total; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -434,12 +436,13 @@ public class PdfPTable implements LargeElement { |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
totalHeight = 0; |
|
|
|
totalHeight = 0; |
|
|
|
BorderStyle borderStyle = tableProperties.getBorderStyle(); |
|
|
|
BorderStyle borderStyle = tableProperties.getBorderStyle(); |
|
|
|
float borderWidth = borderStyle.getBorderWidth(); |
|
|
|
float borderWidth = tableProperties.isCollapse() ? borderStyle.getBorderWidth() / 2 : borderStyle.getBorderWidth(); |
|
|
|
float cellspacing = tableProperties.getCellspacing(); |
|
|
|
float cellspacing = tableProperties.getCellspacing(); |
|
|
|
|
|
|
|
float cellpadding = tableProperties.getCellpadding(); |
|
|
|
for (int k = 0; k < rows.size(); ++k) { |
|
|
|
for (int k = 0; k < rows.size(); ++k) { |
|
|
|
totalHeight += getRowHeight(k, firsttime); |
|
|
|
totalHeight += getRowHeight(k, firsttime); |
|
|
|
} |
|
|
|
} |
|
|
|
totalHeight += (borderWidth + cellspacing) * (rows.size() + 1); |
|
|
|
totalHeight += (rows.size() + 1) * 2 * borderWidth + cellpadding * 2 * rows.size() + (rows.size() + 1) * cellspacing; |
|
|
|
return totalHeight; |
|
|
|
return totalHeight; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|