CMS솔루션마켓, 이온디 - 워드프레스, 라이믹스, 카페24, 그누보드, 엑셀

프리랜서 커뮤니티

http://shinnaji.com/blog/tb.php/?tb_id=123http://shinnaji.com/blog?no=123강제로 나누고 싶은 부분에다가

style="page-break-before:always;"를 추가하세요...

<tr style="page-break-before:always;">  뭐 이런 식으루....

before를 넣으면 그 스타일 쉬트 쓴 앞에서 강제로 페이지 분할을 하고, after를 쓰면 뒤에서 분할합니다.


그리고 아래의 소스를 이용하시면 머릿글과 바닥글을 바꾸어 깔끔하게 출력할 수 있습니다.

<script language="javascript">
function printWindow() {
factory.printing.header = "여기는 머릿글입니다." //머릿글
factory.printing.footer = "여기는 바닥글입니다." //바닥글
factory.printing.portrait = true //세로 출력, false는 가로 출력
factory.printing.leftMargin = 30.0 //왼쪽 여백
factory.printing.topMargin = 30.0 //위쪽 여백
factory.printing.rightMargin = 30.0 //오른쪽 여백
factory.printing.bottomMargin = 30.0 // 바닥 여백
factory.printing.Print(false, window) // false는 프린트 대화 상자표지 안함, true는 표시함, window는 전체 페이지 출력
}
</script>

<object id="factory" viewastext  style="display:none"
  classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
  codebase="http://www.meadroid.com/scriptx/ScriptX.cab#Version=6,1,431,2">
</object>

<input type="button" name="print" value="Print This Page..." onClick="printWindow();">
<A href="javascript:printWindow()">



factory.printing.header = "" //이렇게 하면  머릿글(html의 타이틀제목, 페이지수)이 없이 출력됩니다.
factory.printing.footer = "" //이렇게 하면 바닥글(html의 경로, 날자)이 없이 출력됩니다.


출처: http://shinnaji.com/blog?no=123


추천한 사람