javascript - Place a horizontal rule in a div -


i have div used display users data.

this div used simulate how users data printed. users printed data can 1 or many pages long.

i trying simulate page break on div each time height of div reaches height of 3507px.

i have searched & google find solution, stumped. unsure if can accomplished using css or jquery.

how display horizontal rule or other such line break indicator in div (to indicate page break) each time height of div reaches height of 3507px?

here html code of div:

<div style="border: 2px dashed red;">     <div id="live_preview" class="livepreview_resumewrapper2"></div> </div> 

here css:

.livepreview_resumewrapper2 {     background: #fff;     border: 1px solid #000;     box-shadow: 10px 10px 5px 0 #888;     direction: ltr;     padding: 20px;     width: 100% } 

i appreciate suggestion. thanks.

the idea occures me is:

1)get height of page

var page_height = $('.page').height();

2)get count of hr require

var hr_count = math.floor(page_height / 3507);

3)set page relative

.page{ position: relative}

4)now knowing count of hr need display append them page absolute position;

for(i=1; i<=hr_count; ++i){    $('.page').append('<hr style="position: absolute; top: ' + * 3507 + 'px;"');} 

the issue see hr may appear straight on top of text, @ least know there goes line break.

why 3507px? if changes margins of print setup, or uses different type of paper a4, a3, letter?

best regards


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -