php - Change main view position codeigniter


I have some problem with position off my tables.

here you can see what is looking now:

My controller:

?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Manage_products extends CI_Controller {

public function __construct()


public function index()

    $this->data['products'] = $this->Products_model->get_all();
    $this->data['title'] = 'Product Management';

    $this->data['message'] = $this->session->flashdata('message');
        $this->load->view('main_view', $this->data);
    $this->load->view('manage_products', $this->data);


view off manage_products Products table, td, th { border:1px solid green; } th { background-color:green; color:white; }

        #infoMessage p{
            padding: .8em;
            margin-bottom: 1em;
            border: 2px solid #ddd;
            background: #FFF6BF;
            color: #817134;
            border-color: #FFD324;
            text-align: center;
        <table width="700" border="0" align="center">
                <td><h2>Parduotuvės </h2></td>
                <td><div id="infoMessage"><?php echo $message;?></div></td>
                <td><input name="New" type="button" value="Pridėti naują" onclick="window.location='product/add'" /></td>
        <form name="frmproduct" method="post">
            <input type="hidden" name="rid" />
            <input type="hidden" name="command" />
            <table width="700" align="center">
                    <th width="150"><strong>Parduotuvės pavadinimas</strong></th>
                    <th><strong>Prekės identifikatorius</strong></th>
                foreach ($products as $product){
                    $product_id = $product['id'];
                        <td><?php echo $product['pavadinimas'] ?></td>
                        <td><?php echo $product['prekesid'] ?></td>
                        <td><?php echo $product['linkas'] ?></td>
                        <td><a href='product/edit/<?php echo $product_id ?>'>Redaguoti</a></td>
                                echo anchor('product/delete/'.$product_id, 'Delete', array('onClick' => "return confirm('Ar tikrai norite ištrinti?')"));

I think problem is with line 22. I must load main_view, but my table must be in main_view, not in bottom. How to fix this problem?




I think I under stood correct try something like

return $this->load->view('name', null, true) or $this->load->view('name', $data, true)

could try and use null or true, return for tables.

People are also looking for solutions to the problem: php - MySQL Syntax Error


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.