Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
9253 Widoki

Hy Every body

I am try to use page break before when I want to convert html to pdf report by webkit but it doesn't work .

So I need To any one can help me to solve this issue

This is my script but the bage break is not work

<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $('table.basic_table').each(function(i, tabela){
            var per_page = 5;
            
            var pages = Math.ceil($('tbody tr').length / per_page);

            if (pages == 1)
                return;

            var ultimo = $(tabela);
            for(var p = 1; p <= pages; p++) {
                var copy = ultimo.clone();

                $('tbody tr', ultimo).each(function(i, tr){
                    if (i >= per_page) {
                        $(tr).remove();
                    }
                });

                $('tbody tr', copy).each(function(i, tr){
                    if (i < per_page) {
                        $(tr).remove();
                    }
                });

                if (p < pages)
                    copy.insertAfter(ultimo);

                copy.css('page-break-before', 'always');

                ultimo = copy;
            }
        });
    });
</script>

Thanks Alot

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
mar 25
2083
1
mar 25
2181
2
lip 24
4663
1
maj 24
3139
2
lut 24
3833