Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82030

Sollution for print image in your tables.

$
0
0

Hi guys.

This easy and simple method to print images in tables.

Just change this code in your datatable.js

            }
            // Inject the table and other surrounding information
                    win.document.body.innerHTML =
                        '<h1>'+exportInfo.title+'</h1>'+
                        '<div>'+(exportInfo.messageTop || '')+'</div>'+
                        html+
                        '<div>'+(exportInfo.messageBottom || '')+'</div>';

                    $(win.document.body).addClass('dt-print-view');

                    $('img', win.document.body).each( function ( i, img ) {
                        img.setAttribute( 'src', _relToAbs( img.getAttribute('src') ) );
                    } );

                    if ( config.customize ) {
                        config.customize( win );
                    }

TO

                }
                // Inject the table and other surrounding information
                         var pageTitle = 'Page Title',
                                        stylesheet = '',
                                        win = window.open('', '', 'width=800,height=600');
                                    win.document.write('<html><head><title>' + pageTitle + '</title>' +

                                        '</head><body>' + $('.table')[0].outerHTML + '</body></html>');
                                        win.document.close();

                        // Allow stylesheets time to load

_
thats all. so funny.


Viewing all articles
Browse latest Browse all 82030

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>