echo "<html>";
echo "<head>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">";
echo "<title>luxporn</title>";
echo "<style type=\"text/css\">";
echo "<!--";
echo ".style4 {";
echo " font-family: Arial, Helvetica, sans-serif;";
echo " font-size: 12px;";
echo "}";
echo ".style5 {";
echo " font-family: Arial, Helvetica, sans-serif;";
echo " font-size: 18px;";
echo "}";
echo "body {";
echo " margin-top: 0px;";
echo "}";
echo "-->";
echo "</style></head>";
echo "<body>";
//---------------------------------
$flg=1;
while ($row = mysql_fetch_array($result)) {
//---判断有无图片--
if(!$row[1])
{
echo "<table width=\"704\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">";
echo " <tr>";
echo " <th colspan=\"2\" scope=\"col\"><div align=\"left\"><strong><span class=\"style5\">$row[0]</span></strong></div></th>";
echo " </tr>";
echo "<br>";
echo "<tr>";
echo " <td valign=\"top\"><div align=\"left\" ><span class=\"style4\">$row[2]</span></div></td>";
echo " </tr>";
echo " <tr>";
echo " </tr>";
}else if($flg==1){
//--有图片则输出图片---
echo "<table width=\"704\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">";
echo " <tr>";
echo " <th colspan=\"2\" scope=\"col\"><div align=\"left\"><strong><span class=\"style5\">$row[0]</span></strong></div></th>";
echo "<br>";
echo " </tr>";
echo " <tr>";
//---左排
echo " <td width=\"50%\"><div align=\"left\"><img name=\"\" src=\"$row[1]\" width=\"50%\" alt=\"\"></div></td>";
echo " <td valign=\"top\" width=\"550\"><div align=\"left\" ><span class=\"style4\">$row[2]</span></div></td>";
echo " </tr>";
echo " <tr>";
echo " </tr>";
$flg=2;
}else if($flg==2) {
//---右排
echo "<table width=\"704\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">";
echo " <tr>";
echo " <tr>";
echo " <td colspan=\"2\"><div align=\"left\"><strong><span class=\"style5\">$row[0]</span></strong></div></td>";
echo " </tr>";
echo "<br>";
echo " <tr>";
echo " <td valign=\"top\"><div align=\"left\"><span class=\"style4\">$row[2]</span></div></td>";
echo " <td><div align=\"right\" ><img name=\"\" src=\"$row[1]\" width=\"50%\" alt=\"\"></div></td>";
echo " </tr>";
#echo " <tr>";
#echo " <tr colspan=\"2\"> </tr>";
#echo " <tr colspan=\"2\"> </tr>";
#echo " <tr colspan=\"2\"> </tr>";
echo " </tr>";
echo " <tr>";
echo " <td colspan=\"2\"><div align=\"left\"></div></td>";
echo " </tr>";
echo "</table>";
$flg=1;
}
}
mysql_free_result($result);
echo "</body>";
echo "</html>";
?>
我想让读出来的图片$row[1]和文字$row[2]各占一半,要左上对齐,可是我设了一上午没反应,请高手赐教,谢谢了。