Display Data in two column in Datatable
Display Data in two column in Datatable
I have managed to display data in one column table, but would like to have two column instead. Is there a way of doing it? Here's the code I currently have. Although, it works, it prints in one long column and would like to break the output into two columns like so:
1 2
3 4
5 6
7 8
....
As you can tell, I'm using jQuery Datatable.
[code]
<?php
include('config.php');
mysql_connect($host, $username, $password) or die(mysql_error()) ;
mysql_select_db('people') or die(mysql_error()) ;
$data = mysql_query("SELECT * FROM names ORDER BY RAND() LIMIT 20") or die(mysql_error());
?>
/* @import "datatables/dt/media/css/demo_table.css";
.result_container{
width: 553;
} */
$(document).ready(function(){
$('#the_table').dataTable();
});
<?php
echo "
Latest names
";
while($info = mysql_fetch_array( $data )){
echo" " . $info['name'] . "
";
}
echo" ";
echo " ";
?>
[/code]
Any help would be appreciated very much.
Thank you.
1 2
3 4
5 6
7 8
....
As you can tell, I'm using jQuery Datatable.
[code]
<?php
include('config.php');
mysql_connect($host, $username, $password) or die(mysql_error()) ;
mysql_select_db('people') or die(mysql_error()) ;
$data = mysql_query("SELECT * FROM names ORDER BY RAND() LIMIT 20") or die(mysql_error());
?>
/* @import "datatables/dt/media/css/demo_table.css";
.result_container{
width: 553;
} */
$(document).ready(function(){
$('#the_table').dataTable();
});
<?php
echo "
Latest names
";
while($info = mysql_fetch_array( $data )){
echo" " . $info['name'] . "
";
}
echo" ";
echo " ";
?>
[/code]
Any help would be appreciated very much.
Thank you.
This discussion has been closed.
Replies