|
|
|
@ -350,12 +350,14 @@ public class PdfPTable implements LargeElement {
|
|
|
|
|
return; |
|
|
|
|
float total = 0; |
|
|
|
|
int numCols = getNumberOfColumns(); |
|
|
|
|
float cellSpacings = tableProperties.isCollapse() ? 0 : tableProperties.getCellspacing(); |
|
|
|
|
float borderWidth = tableProperties.getBorderStyle().getBorderWidth(); |
|
|
|
|
BorderStyle borderStyle = tableProperties.getBorderStyle(); |
|
|
|
|
float borderWidth = tableProperties.isCollapse() ? borderStyle.getBorderWidth() / 2 : borderStyle.getBorderWidth(); |
|
|
|
|
float cellspacing = tableProperties.getCellspacing(); |
|
|
|
|
float cellpadding = tableProperties.getCellpadding(); |
|
|
|
|
for (int k = 0; k < numCols; ++k) |
|
|
|
|
total += relativeWidths[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; |
|
|
|
|
totalHeight = 0; |
|
|
|
|
BorderStyle borderStyle = tableProperties.getBorderStyle(); |
|
|
|
|
float borderWidth = borderStyle.getBorderWidth(); |
|
|
|
|
float borderWidth = tableProperties.isCollapse() ? borderStyle.getBorderWidth() / 2 : borderStyle.getBorderWidth(); |
|
|
|
|
float cellspacing = tableProperties.getCellspacing(); |
|
|
|
|
float cellpadding = tableProperties.getCellpadding(); |
|
|
|
|
for (int k = 0; k < rows.size(); ++k) { |
|
|
|
|
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; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|