print specific div from the page position cant controled

40 views Asked by At

i have html page

<table class='table table-responsive table-hover table-responsive sortable draggable' id='print' border='5'>
                                    <thead>
                                        <tr class='warning'>
                                            <td>head1 <a class='delete'>delete</a></td>
                                            <td>head2 <a class='delete'>delete</a></td>
                                            <td>head3 <a class='delete'>delete</a></td>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr>
                                            <td>body1 body1 body1dfsffffffffffffffffffffffff </td>
                                            <td>body2</td>
                                            <td>body3</td>
                                        </tr>
                                        <tr>
                                            <td>body4</td>
                                            <td>body5</td>
                                            <td>body6</td>
                                        </tr>
                                        <tr>
                                            <td>body7</td>
                                            <td>body8</td>
                                            <td>body9</td>
                                        </tr>
                                    </tbody>
                                    <tfoot>
                                        <tr>
                                            <td></td>
                                            <td></td>
                                            <td></td>
                                        </tr>
                                    </tfoot>
                                </table>

and when i need to print the page i just want to print the table i used this css ..

@media print 
{
 body * 
 {
    visibility: hidden;
}
#print, #print * 
{
    visibility: visible;
}
#print 
{
    position: absolute;
    left: 0;
    top: 0;
}
}

and when i print the screen the table come in the center not in the top 0px how cound i let the table be absolute; its not working thank you

0

There are 0 answers