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 it into two columns.
As you can tell, I’m using jQuery Datatable.
<?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());
?>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script src="datatables/dt/media/js/jquery.dataTables.js">
</script>
<style type="text/css">
/* @import "datatables/dt/media/css/demo_table.css";
.result_container{
width: 553;
} */
</style>
<script>
$(document).ready(function(){
$('#the_table').dataTable();
});
</script>
</head>
<body>
<?php
echo "<table id=\"the_table\">
<thead>
<tr>
<th>Latest names</th>
</tr>
</thead>
<tbody> ";
while($info = mysql_fetch_array( $data )){
echo"<tr> <td>" . $info['name'] . "</td>
</tr>";
}
echo" </tbody> ";
echo "</table> ";
?>
</body>
</html>
Any help will be appreciated very much.
?>