/************************************
Configration
************************************/
/*
** init vars
*/
$config = array();
//$config[column]用来指定生成的表格的列数
$config[column] = 4;
//$config[row]用来指定生成的表格的行数
$config[row] = null;
$result = array();
/*
** get data array from db
*/
$sql = "SELECT doc_id,title,channel_id FROM document ORDER BY doc_id LIMIT 14";
$result = $db->query($sql);
if(!$config[row]) $config[row] = (int) $db->num_rows / $config[column];
/*
** output html
*/
echo "
\n";
for($i=0;$i<$config[row];$i++)
{
if($tr == false)
{
$tr = true;
echo "";
}
for($j=0;$j<$config[column];$j++)
{
if($td == false)
{
$td = true;
echo ""; } list($k,$v) = each($result); if($v != "") echo "id:$v[doc_id] title:$v[title] channel_id:$v[channel_id]"; else echo " "; if($td == true) { $td = false; echo " | ";
}
}
if($tr == true)
{
$tr = false;
echo "
";
}
}
echo "
\n";