custom print page

custom print page

raspoteenraspoteen Posts: 16Questions: 8Answers: 0

Hi, I want align the table RTL in the print page, by adding this code to the style
style="direction: rtl"
How can I do that ?


and this is my print button Code

{ extend: 'print',text: '<i class="fa fa-plus" aria-hidden="true"><span class="{{ App::isLocale('ar')? 'font-ar' : '' }}">@lang('master.print')</span></i>',
                        title: '@lang('invoices.products')',
                        messageTop: '{{ Auth::user()->office_name }}',
                        className: 'btn btn-default',
                        autoPrint: true,

                        customize: function (win) {
                            $(win.document.body).find('th').addClass('display').css('text-align', 'center');
                            $(win.document.body).find('table').addClass('display').css('font-size', '16px');
                            $(win.document.body).find('table').addClass('display').css('text-align', 'center');
                            $(win.document.body).find('tr:nth-child(odd) td').each(function (index) {
                                $(this).css('background-color', '#D0D0D0');
                            });
                            $(win.document.body).find('h1').css('text-align', 'center');

                        }}

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    Answer ✓

    It looks like you are already 99% of the way there:

    $(win.document.body).css('direction', 'rtl');
    

    should do it I think.

    Allan

This discussion has been closed.