dousha7904 2015-03-01 18:19
浏览 44

Codeigniter - 使用分页而不使用表格

I found two questions that are not similar to mine so they weren't any help.

What I'm trying to do is use pagination feature without using table because I need to show the data to the user not in a table format. In other words, they will see the name, the date and other stuff in a non-table format.

My controller:

 $uid = $this->session->userdata('uid'); //added on sat , feb 28

    $this->load->library('pagination');
    $this->load->library('table');

    $this->table->set_heading('');



    $config['base_url'] = 'http://localhost/profile/entries';

    $config['total_rows'] = $this->db->get_where('notes', array('uid' => $uid))->num_rows();
    $this->db->where('uid', $uid);
    $this->db->order_by("time", "desc"); 
    $config['per_page'] = 20;
    $config['num_links'] = 2;

    $config['first_link'] = FALSE;
    $config['last_link'] = FALSE;


    $this->pagination->initialize($config);

    $data['records'] = $this->db->get('notes', $config['per_page'], $this->uri->segment(3));
    $this->pagination->create_links();


    $this->load->view('profile/includes/header');
    $this->load->view('profile/view_all_notes', $data);

My view File

<html>
    <body>
<div class="container">

        <h3 class="block-title block-title--simple"> Your <?php echo $site_title ?> Notes </h3>

    foreach ($query->result() as $row) :
     <?php

        foreach ($query->result() as $row) :

            ?>
                <div class="col-md-4">
                    <h1><?php echo $row['message']; ?></h1>
                    <h2><?php echo $row['time']; ?></h2>
                </div>
                <?php

        endforeach;
    ?>  

     <?php echo $this->pagination->create_links(); ?>



        </div>

    </body>
</html>

I have tried doing that but it doesn't show it. I just dont want it showing in the table format. Thanks.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
    • ¥100 为什么这个恒流源电路不能恒流?
    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 CSAPPattacklab
    • ¥15 一直显示正在等待HID—ISP
    • ¥15 Python turtle 画图
    • ¥15 stm32开发clion时遇到的编译问题
    • ¥15 lna设计 源简并电感型共源放大器