Hide table column but still retrieve its values

Hide table column but still retrieve its values

rubinjo13rubinjo13 Posts: 4Questions: 3Answers: 0
edited May 2017 in Free community support

I have a table column with the name "status", when the value is 1 the row will be yellow, if the value is 2 the row will be green.

How can i hide this column while still being able to retrieve its value?

<div class="container-fluid">
     <table id="table_id" class="cell-border order-column row-border hover compact"  width="100%">
        <thead>
            <tr>
            <th width="2%">ID</th>
            <th width="6%">Debiteur</th>
            <th width="10%">Klantnaam</th>
            <th width="3%">Aantal Pallets</th>
            <th width="3%">Totaal Gewicht</th>
            <th width="28%">PB Nummers</th>
            <th width="10%">Toevoegdatum</th>
            <th width="1%">status</th>
            <th width="11%">Edit</th>
            </tr>
        </thead>
        <tbody>
            <!-- Fetch from db -->
            <!-- Connect to db-->>
         <?php
         $conn = mysqli_connect("localhost","root","","export") or die("Error in Connection");

         $query = mysqli_query($conn, "SELECT exportid, deb_nmr, cost_name, numb_pal, tot_weight, pb_s, date, statusid FROM export_tabel");
            $colors = ['white', '#ffbb33', '#00C851'];
            while ($result = mysqli_fetch_array($query)) {
                echo "<tr style='background-color: ".$colors[$result['statusid']].";'>
                    <td>".$result['exportid']."</td>
                    <td>".$result['deb_nmr']."</td>
                    <td>".$result['cost_name']."</td>
                    <td>".$result['numb_pal']."</td>
                    <td>".$result['tot_weight']."</td>
                    <td>".$result['pb_s']."</td>
                    <td>".$result['date']."</td>
                    <td>".$result['statusid']."</td>
                    <td><a href=\"update.php?id=$result[exportid]\"><button type='button'  class='btn btn-success btn-xs glyphicon glyphicon-edit'></button></a>
                    <a href=\"delete.php?id=$result[exportid]\"><button type='button' class='btn btn-danger btn-xs glyphicon glyphicon-remove-circle'></button></a>
                    |
                    <a href=\"gereed.php?id=$result[exportid]\"><button type='button' class='btn btn-warning btn-xs glyphicon glyphicon-thumbs-up'></button></a>
                    <a href=\"afgehaald.php?id=$result[exportid]\"><button type='button' class='btn btn-primary btn-xs glyphicon glyphicon-road'></button></a>
                    <a href='#'><button type='button' class='btn btn-danger btn-xs'>CMR</button>
                    
                </tr>";
            }
            
            ?>
        </tbody>
     </table> 
   </div>
    <script>    
        $(document).ready(function(){
        $('#table_id').DataTable();  
         });
     
    </script>

This discussion has been closed.