Jump to content
php.lv forumi

PHP+MySQL=>print


Gizmo

Recommended Posts

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>3 kolonas</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table width="50%"  border="1">
<?php
include("connect.php");
$sql = "select * from test";
$rez = mysql_query($sql)or die(mysql_error());
$i = 3;
while($row = mysql_fetch_array($rez)){
if($i % 3 == 0){
echo "<tr><td>{$row[value]}</td>";
}
elseif($i % 3 == 1){
echo "<td>{$row['value']}</td>";
}
elseif($i % 3 == 2){
echo "<td>{$row['value']}</td></tr>";
}
$i++;
}
?>
</table>
</body>
</html>

Link to comment
Share on other sites

  • 1 month later...

Kā lai dobon to ka bildes paklaujas manis definētajiem <td> izmēriem un katra attieciigi samazinaas vai palielinaas attieciibaa pret oriģinālu?

 

printf("
<table class=table2 align=center bgcolor=black height=200 width=150 border=0>
<tr><td bgcolor=white width=150 height=150 align=center>
<img align=center src=\"visi/%s.jpg\">
</td></tr>
<tr><td bgcolor=gray height=50><font size=1>%s</font>
</td></tr></table>",$row["nosaukums"],$row["nosaukums"]);

Link to comment
Share on other sites

Tiešām nau ideju kā dabūt lai <td width=150> neizplestos ja tajaa ieliek lielāku bildi? Variants <img width=150> neder jo attēlojamā bilde var būt arī mazāka un tad slikti izskatīsies.

Link to comment
Share on other sites

×
×
  • Create New...