PHP Classes

File: 05_hiding_columns.php

Recommend this page to a friend!
  Classes of Alexandre Sinício   PHP Array into HTML Table   05_hiding_columns.php   Download  
File: 05_hiding_columns.php
Role: Example script
Content type: text/plain
Description: Example - Hiding unwanted columns
Class: PHP Array into HTML Table
Generate HTML tables from data in arrays
Author: By
Last change:
Date: 8 years ago
Size: 429 bytes
 

Contents

Class file image Download
<?php
   
use alesinicio\HTMLTable;

    require
"../HTMLTable.php";
   
   
$arrHeaders = array(
       
"First column", "Second column", "Third column", "Fourth column"
   
);
   
   
$arrData = array(
        array(
"this", "is", "first", "row"),
        array(
"could", "come", "from", "database")
    );
   
   
$table = new HTMLTable();
   
$table->setData($arrData);
   
$table->setHeaders($arrHeaders);
   
$table->hideColumn(1);
    echo
$table->getHTML();