Hi,
I want to dynamically resize rows and columns with JavaScript in EO.PDF 6.0.36.2, but the JavaScript engine returns far to small values for every width property.
Code:
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
table.parent { table-layout: fixed; width: 100%; border-collapse: collapse; border-spacing: 0; border-color: blue; border-style: solid; border-width: 1px; }
</style>
</head>
<body>
<table id="tableparent" class="parent">
<tr id="tablerow">
<td id="tablecolumn">
</td>
</tr>
<script>
var tableparent = document.getElementById('tableparent');
var tablerow = document.getElementById('tablerow');
var tablecolumn = document.getElementById('tablecolumn');
console.log("PARENT offsetwidth: " + tableparent.offsetWidth + " width: " + tableparent.width + " clientwidth: " + tableparent.clientwidth + " scrollwidth: " + tableparent.scrollWidth);
console.log("ROW offsetwidth: " + tablerow.offsetWidth + " width: " + tablerow.width + " clientwidth: " + tablerow.clientwidth + " scrollwidth: " + tablerow.scrollWidth);
console.log("COLUMN offsetwidth: " + tablecolumn.offsetWidth + " width: " + tablecolumn.width + " clientwidth: " + tablecolumn.clientwidth + " scrollwidth: " + tablecolumn.scrollWidth);
</script>
</table>
</body>
</html>
Height is working, but width only returns correct values if the width is set to absolute values (e.g "width: 100px;") not in percentage ("width: 100%;") as in my example. Every tested browser (IE, Chrome, Firefox) returns correct values for my example, but not EO.
EO (6.0.36.2) Log for the above html:
Code:
PARENT offsetwidth: 1 width: clientwidth: undefined scrollwidth: 6
ROW offsetwidth: 0 width: undefined clientwidth: undefined scrollwidth: 0
COLUMN offsetwidth: 0 width: clientwidth: undefined scrollwidth: 5
Chrome (43.0.2357.124) Log for the above html:
Code:
PARENT offsetwidth: 1533 width: clientwidth: undefined scrollwidth: 1532
ROW offsetwidth: 1532 width: undefined clientwidth: undefined scrollwidth: 1532
COLUMN offsetwidth: 1532 width: clientwidth: undefined scrollwidth: 1531
Do I have to calculate the width by myself because relative values are not supported or is this a bug in the current Version?
Thanks
Guenter