Is it possible to place a background image on a table using the jquery datatable plugin?

2

I have tried the following ways without result ...

... in the body of the table

<tbody background="./images/credibanco.jpg" style="background-repeat: no-repeat; background-position: center center;">     
 <?php
 require_once '../ConsultasSW/ConsolidadoOperacionClientesSW.php';
 echo ConsolidadoOperacionClientes($_POST["v1"], $_POST['v3'], $_POST['v4']);
 ?>

on the div that contains the table

<div id="operacionClientes" style="background-image: url(./images/credibanco.jpg)">
    <table id="opeClientes" class="display nowrap" cellspacing="0" width="100%" style="text-transform: uppercase; font-size: 11px; text-align: center;">
        <thead>
            <tr>
                <th>Cantidad de productos</th>                                                                    
                <th>Valor total</th>
                <th>Tipo de entrega</th>
            </tr>
        </thead>
        <tfoot>
            <tr>
                <th>Cantidad de productos</th>                                                                    
                <th>Valor total</th>
                <th>Tipo de entrega</th>
            </tr>
        </tfoot>
        <tbody>
            <?php
                require_once '../ConsultasSW/ConsolidadoOperacionClientesSW.php';
                echo ConsolidadoOperacionClientes($_POST["v1"], $_POST['v3'], $_POST['v4']);
                ?>
            </tbody>
        </table>

but I did not manage to get it, what I need is that the image is in the background in the watermark table so that it does not become complicated to understand the contents of the table ...

    
asked by csjo 03.05.2018 в 21:17
source

1 answer

2

With this piece of code that you sent you can solve your problem.

<style type="text/css" media="screen">
    .thead{
        background-image: url('tuimagen.jpg');
    }
</style>

<table>
    <thead class="thead">
        <tr>
            <th>1</th>
            <th>2</th>
            <th>3</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>1</td>
            <td>2</td>
            <td>3</td>
        </tfoot>
</table>
    
answered by 03.05.2018 в 21:24