RE: [PHP-DB] formating problem
| From: | Beau Lebens | Date: | Wed, 20 Feb 2002 02:16:28 +0000 |
| Subject: | RE: [PHP-DB] formating problem | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-17078@lists.php.net to get a copy of this message | ||
htat's because the delete button is in the wrong place in your code.
if you put an HTML element between the <table> and </table> tags, but don't
enclose it in at least <tr> and <td> tags (pretty loose about closing them,
but of course you should always close your tags!) then the browser will
display that element above the table - since it doesn't really know where
you want it placed.
long story short, replace the last little section of your code with
echo "<tr>\n<td colspan=\"2\" align=\"center\"><input
type=\"submit\"
name=\"delete\"
value=\"delete\"></td>\n</tr>\n\n</form></table>";
?>
and PS. i don't know if you are doing it by mistake or intentionally, but
you may have noticed that form elements cause a certain amount of space to
be taken up because the browser decides to render them as a <br> or
something for some reason. if you put the <form> and </form> elements
BETWEEN a <tr> and a <td> or a <table> and a <tr> or something (i.e. not
properly located in a <td></td> pair) then this formatting is not displayed
for some reason - go figure.
enjoy
beau
// -----Original Message-----
// From: jas [mailto:jlgerfen@hotmail.com]
// Sent: Tuesday, 19 February 2002 7:13 PM
// To: php-db@lists.php.net
// Subject: [PHP-DB] formating problem
//
//
// I feel kinda dumb for posting this but here it is... I am
// trying to query a
// table then format the results so it looks like the rest of
// the site and the
// darn delete button to remove db entries keeps showing up at
// the top. Here
// is the code... Thanks in advance.
// Jas
// <?php
// require '../scripts/db.php';
// $result = mysql_query("SELECT * FROM cur_inv",$dbh) or die("Could not
// execute query, please try again later");
// echo "<table border=\"0\" class=\"table-body\"
width=\"100%\"><form
// name=\"rem_inv\" method=\"post\" action=\"done2.php3\">
// <tr><td align=\"center\" colspan=\"2\"><font
size=\"4\"><B>Current
// Inventory</B></font><hr
color=\"333333\"></td></tr>";
// $count = -1;
// while ($myrow = mysql_fetch_row($result)) {
// $count ++;
// echo "<tr><td width=\"30%\"><B>Type Of Car:
</B></td><td>";
// printf(mysql_result($result,$count,"car_type"));
// echo "</td><td><input type=\"checkbox\" name=\"car_type\"
// value=\"checkbox\">remove</td>
// </tr>\n";
// echo "<tr><td width=\"30%\"><B>Model Of Car:
</B></td><td>";
// printf(mysql_result($result,$count,"car_model"));
// echo "</td></tr>\n";
// echo "<tr><td width=\"30%\"><B>Year Of Car:
</B></td><td>";
// printf(mysql_result($result,$count,"car_year"));
// echo "</td></tr>\n";
// echo "<tr><td width=\"30%\"><B>Price Of Car:
</B></td><td>$";
// printf(mysql_result($result,$count,"car_price"));
// echo "</td></tr>\n";
// echo "<tr><td width=\"30%\"><B>VIN Of Car:
</B></td><td>";
// printf(mysql_result($result,$count,"car_vin"));
// echo "</td></tr><tr><td colspan=\"3\"><hr
// color=\"333333\"></td></tr>\n";
// }
// echo "<input type=\"submit\" name=\"delete\"
// value=\"delete\"></form></table>";
// ?>
//
//
//
// --
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
//