HTML
<table id="tables" class="table table-striped table-bordered table-hover"> <thead> <tr> <th>用户</th> <th>内容</th> <th>时间</th> </tr> </thead> <tbody> </tbody> </table>
引入jQuery和dataTables相关插件
<script src="js/jquery.js"></script> <script src="js/jquery.dataTables.min.js"></script> <script src="js/jquery.dataTables.bootstrap.js"></script>
最后附上数据库信息:
CREATE TABLE IF NOT EXISTS `wishing_wall` ( `id` int(11) NOT NULL AUTO_INCREMENT, `content` varchar(200) NOT NULL, `color` int(3) DEFAULT '1', `xyz` varchar(100) DEFAULT NULL, `name` varchar(30) DEFAULT NULL, `addtime` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;