Ejemplo n.º 1
0
<?php

include './tabla.php';
include './celda.php';
$tabla1 = new Tabla(5, 3);
$tabla1->cargar(1, 1, "Columna 1", "white", "blue");
$tabla1->cargar(1, 2, "Columna 2", "white", "blue");
$tabla1->cargar(1, 3, "Columna 3", "white", "blue");
for ($f = 2; $f <= 10; $f++) {
    $tabla1->cargar($f, 1, "texto1", "orange", "white");
    $tabla1->cargar($f, 2, "texto2", "orange", "white");
    $tabla1->cargar($f, 3, "texto3", "orange", "white");
}
$tabla1->graficar();
Ejemplo n.º 2
0
    public function graficar()
    {
        $this->inicioTabla();
        for ($f = 1; $f <= $this->cantFilas; $f++) {
            $this->inicioFila();
            for ($c = 1; $c <= $this->cantColumnas; $c++) {
                $this->mostrar($f, $c);
            }
            $this->finFila();
        }
        $this->finTabla();
    }
}
$tabla1 = new Tabla(10, 3);
//las 3 ptimeras es para determinar el titulo de las 3 columnas
$tabla1->cargar(1, 1, "columna 1", "#356AA0", "#FFFF88");
$tabla1->cargar(1, 2, "columna 2", "#356AA0", "#FFFF88");
$tabla1->cargar(1, 3, "columna 3", "#356AA0", "#FFFF88");
for ($f = 2; $f <= 10; $f++) {
    //empiza en fila 2 para no escribir en el titulo
    //determinamos el texto/color/ de cada fila
    $tabla1->cargar($f, 1, "texto", "blue", "grey");
    $tabla1->cargar($f, 2, "texto", "red", "yellow");
    $tabla1->cargar($f, 3, "texto", "green", "greenyellow");
}
$tabla1->graficar();
?>
    </body>
</html>