public function draw($data) {

        // if the data is sane, and the widths have been set (if not calculate them)
        if ($this->dataCheck($data)) {

            $barStyle = new Style();

            // set the colors to the bar text and fill
            $barStyle->setColors($this->barText, $this->barFill);
            
            $bodyStyle = new Style();
            
            // set the colors to the body text and fill
            $bodyStyle->setColors($this->bodyText, $this->bodyFill);
            
            
            
            // calculate the widths
            $this->calculateWidths($data);
            
            // calculate the total width
            $totalWidth = $this->calcTotalWidth();

            // if at least one of the columns has header text
            if ($this->hasHeader()) {

                
                $headers = $this->getHeaderText();
                
                // if a title was specified
                if ($this->title) {

                    // center the title
                    $justifiedText = $this->clio->justify($this->title, "center", $totalWidth);

                    // create a title style
                    $titleStyle = new Style();
                    $titleStyle->setBold()->setTextColor($this->bodyText);

                    // ask Clio to draw it
                    $this->clio->style($titleStyle)->display($justifiedText)->clear()->newLine();
                }

                // draw the row of cells
                $this->drawRow($headers, $barStyle);

            }
            
            // go through each row of data
            for ($row = 0; $row<count($data); ++$row) {

                // draw the row of cells
                $this->drawRow($data[$row], $bodyStyle);
                
            }

            // if the last line is desired
            if ($this->showBottomLine) {
                
                // now add an empty line
                $emptyLine = str_pad("",$totalWidth);

                // underline it to create a bottom line with the bar fill
                $underline = (new Style())->setUnderscore()->setColors($this->barFill, $this->bodyFill);

                // ask Clio to display it
                $this->clio->style($underline)->display($emptyLine);
            }
            

        }

    }
public function draw($data) {

        // if the data is sane, and the widths have been set (if not calculate them)
        if ($this->dataCheck($data)) {

            $barStyle = new Style();

            // set the colors to the bar text and fill
            $barStyle->setColors($this->barText, $this->barFill);
            
            $bodyStyle = new Style();
            
            // set the colors to the body text and fill
            $bodyStyle->setColors($this->bodyText, $this->bodyFill);
            
            
            
            // calculate the widths
            $this->calculateWidths($data);
            
            // calculate the total width
            $totalWidth = $this->calcTotalWidth();

            // if at least one of the columns has header text
            if ($this->hasHeader()) {

                
                $headers = $this->getHeaderText();
                
                // if a title was specified
                if ($this->title) {

                    // center the title
                    $justifiedText = $this->clio->justify($this->title, "center", $totalWidth);

                    // create a title style
                    $titleStyle = new Style();
                    $titleStyle->setBold()->setTextColor($this->bodyText);

                    // ask Clio to draw it
                    $this->clio->style($titleStyle)->display($justifiedText)->clear()->newLine();
                }

                // draw the row of cells
                $this->drawRow($headers, $barStyle);

            }
            
            // go through each row of data
            for ($row = 0; $row<count($data); ++$row) {

                // draw the row of cells
                $this->drawRow($data[$row], $bodyStyle);
                
            }

            // if the last line is desired
            if ($this->showBottomLine) {
                
                // now add an empty line
                $emptyLine = str_pad("",$totalWidth);

                // underline it to create a bottom line with the bar fill
                $underline = (new Style())->setUnderscore()->setColors($this->barFill, $this->bodyFill);

                // ask Clio to display it
                $this->clio->style($underline)->display($emptyLine);
            }
            

        }

    }
public function draw ( $ data ) { // if the data is sane, and the widths have been set (if not calculate them) if ( $ this -> dataCheck ( $ data ) ) { $ barStyle = new Style ( ) ; // set the colors to the bar text and fill $ barStyle -> setColors ( $ this -> barText , $ this -> barFill ) ; $ bodyStyle = new Style ( ) ; // set the colors to the body text and fill $ bodyStyle -> setColors ( $ this -> bodyText , $ this -> bodyFill ) ; // calculate the widths $ this -> calculateWidths ( $ data ) ; // calculate the total width $ totalWidth = $ this -> calcTotalWidth ( ) ; // if at least one of the columns has header text if ( $ this -> hasHeader ( ) ) { $ headers = $ this -> getHeaderText ( ) ; // if a title was specified if ( $ this -> title ) { // center the title $ justifiedText = $ this -> clio -> justify ( $ this -> title , "center" , $ totalWidth ) ; // create a title style $ titleStyle = new Style ( ) ; $ titleStyle -> setBold ( ) -> setTextColor ( $ this -> bodyText ) ; // ask Clio to draw it $ this -> clio -> style ( $ titleStyle ) -> display ( $ justifiedText ) -> clear ( ) -> newLine ( ) ; } // draw the row of cells $ this -> drawRow ( $ headers , $ barStyle ) ; } // go through each row of data for ( $ row = 0 ; $ row < count ( $ data ) ; ++ $ row ) { // draw the row of cells $ this -> drawRow ( $ data [ $ row ] , $ bodyStyle ) ; } // if the last line is desired if ( $ this -> showBottomLine ) { // now add an empty line $ emptyLine = str_pad ( "" , $ totalWidth ) ; // underline it to create a bottom line with the bar fill $ underline = ( new Style ( ) ) -> setUnderscore ( ) -> setColors ( $ this -> barFill , $ this -> bodyFill ) ; // ask Clio to display it $ this -> clio -> style ( $ underline ) -> display ( $ emptyLine ) ; } } }
Draw the table of data
@param $data
Draw the table of data