Javascript: Insert new rows into table by checking row top position -
I want to insert two new lines when the top position of a line is greater than one limit in pixels. Have tried, but it is not working properly. Maybe you can try adding CSS property to your table header? See . Example: This should add a page break before the heading of each table, so you only need to calculate the situation to start a new table. I'm not able to test it right now, but maybe it will help you.
I am adding these two rows to the page break and repeating the table headers purpose.
Print Preview of this code is running:
The header should only be repeated on the next page.
var x = document.getElementsByTagName ('tr'); Var roto paul = 0; Var tIndex = 0; Var deductVal = 0; Var TablesID = document.getElementById ("testID"); {RowTopVal = x [i] .position () for (Var i = 0; i & lt; x.length; i ++). Top; RowTopVal = WrightTwelve - deductVal; If (1200 & lt; rowTopVal) {tIndex = i; Var line = tableId.insertRow (tIndex); Var cell1 = row.insertCell (0); Var cell 2 = Row.Intel (1); Var cell3 = row.insertCell (2); Var cell4 = row.insertCell (3); Var cell 5 = Row.Intel (4); Cell1.innerHTML = "x"; Cell2.innerHTML = "Y"; Cell3.innerHTML = "z"; Cell4.innerHTML = "P"; Cell5.innerHTML = "q"; Row.className = 'tableHeaderRepeat'; Var line 2 = tableidiinterror (tindex); Row2.className = 'tableHeaderRepeatBlank'; NewRow1Height = parseInt ($ ('tableHeaderRepeatBlank'). CSS ('height'), 10); NewRow2Height = parseInt ($ ('tableHeaderRepeat'). CSS ('height'), 10); DeductVal = deductVal + RingtonesWheel - A new 1Height - newRow2Height; }}
.tableHeaderRepeat {Page-break-first: always; }
Comments
Post a Comment