I'm trying to output a simple table but the resultant layout is unformatted. I don't know why this is happening since the example page of grocery crud is working fine and I'm using their code in my controller as well.
View
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <div> <?php echo $output; ?></div> </body> </html>
Controller
public function __construct() { parent::__construct(); $this->load->database(); $this->load->helper('url'); $this->load->library('grocery_CRUD'); } public function canteen_main_view() { $crud = new grocery_CRUD(); //$crud->set_theme('datatables'); $crud->set_table('item'); $crud->set_subject('Items'); $crud->columns('Name','Price','Category','Photo','Type'); $output = $crud->render(); $this->load->view('Test', $output); }
Result