tabel
pim1991 - 21/01/2006 14:33 (laatste wijziging 21/01/2006 16:20)
PHP interesse
hallo,
ik heb een table gemaakt alleen de tekst staat in het midden
zoiets:
|-----------------------------------------------|
| |
|hallo |
| |
|-----------------------------------------------|
|-----------------------------------------------|
| |
| hallo |
| |
|-----------------------------------------------|
weet iemand wat ik fout doe?
13 antwoorden
Gesponsorde links
ReneeJ - 21/01/2006 14:42
HTML interesse
probeer zoiets..
<table width="515" height="437" border="1">
<tr>
<td valign="top"> </td>
</tr>
</table>
< table width= "515" height= "437" border= "1" >
< tr>
< td valign= "top" >& nbsp;</ td>
</ tr>
</ table>
dan staat de tekst bopvenaan
pim1991 - 21/01/2006 14:44
PHP interesse
heb geprobeerd. doet het nog niet.
ik post de code ff:
<html><head></head><body>
<?php
include "index2.php";
?>
<html>
<head>
<title><? echo $ashopname ?>
</title>
<script language="JavaScript">
function buyItem(itemno)
{
window.open("buy.php?"+itemno,"_blank","toolbar=no, location=no, scrollbars=no, width=450, height=150")
}
</script>
</head>
<center>
<body bgcolor="FFFFFF" text="#000000" link="#000000" alink="#000000" vlink="#000000">
<center>
<table width="100%" border="1" cellspacing="0" cellpadding="0" height="95%">
<P ALIGN="top">
<tr><td width="15%">
<p>
<?
// List categories...
if ($cat) {
$sql="SELECT parentcategoryid from category WHERE categoryid = $cat";
$result = @mysql_query($sql,$db);
$parent = @mysql_result($result, 0, "parentcategoryid");
}
$sql="SELECT categoryid, name FROM category WHERE parentcategoryid = categoryid";
$result = @mysql_query($sql,$db);
for ($i = 0; $i < @mysql_num_rows($result); $i++) {
$categoryname = @mysql_result($result, $i, "name");
$categoryid = @mysql_result($result, $i, "categoryid");
echo "<table width=\"15%\"><tr><td><font face=\"Arial, Helvetica, sans-serif\" size=\"2\"><a href=\"main.php?cat=$categoryid\"><b>$categoryname</b></a></font><br>";
if (($categoryid == $cat) || ($categoryid == $parent)) {
$subsql="SELECT categoryid, name FROM category WHERE parentcategoryid = $categoryid AND categoryid != parentcategoryid";
$subresult = @mysql_query($subsql,$db);
for ($j = 0; $j < @mysql_numrows($subresult); $j++) {
$subcategoryname = @mysql_result($subresult, $j, "name");
$subcategoryid = @mysql_result($subresult, $j, "categoryid");
echo "</td></tr><tr><td><li><font face=\"Arial, Helvetica, sans-serif\" size=\"2\"><a href=\"main.php?cat=$subcategoryid\">$subcategoryname</a></font><br></td></tr></table>";
}
}
}
?>
</p>
</td><td>
<?
// List products belonging to this category...
$sql="SELECT product.* from productcategory, product WHERE productcategory.categoryid = $cat AND product.productid = productcategory.productid";
$result = @mysql_query($sql,$db);
for ($i = 0; $i < @mysql_num_rows($result); $i++) {
$productid = @mysql_result($result, $i, "productid");
$productname = @mysql_result($result, $i, "name");
$description = @mysql_result($result, $i, "description");
$inhoud = @mysql_result($result, $i, "inhoud");
$price = @mysql_result($result, $i, "price");
echo "
<TABLE BORDER=\"0\" width=\"100%\" BORDERCOLOR=\"#000000\" CELLPADDING=\"2\" CELLSPACING=\"0\">
<TR>
<TD BGCOLOR=\"#3399CC\" width=\"30%\"><a href=\"main.php?cat=$productid\">$productname</A></TD>
<TD BGCOLOR=\"#3399CC\" width=\"50%\">$inhoud</TD>
<td bgcolor=\"#3399CC\" width=\"20%\">Koop!</TD>
</TR>
</TABLE>
";
}
@mysql_close($db);
?>
</tr></td>
</td>
</tr>
</table>
</center>
</body></html>
<html><head></head><body>
<?php
include "index2.php" ;
?>
<html>
<head>
<title>
<? echo $ashopname ?> </title>
<script language="JavaScript">
function buyItem(itemno)
{
window.open("buy.php?"+itemno,"_blank","toolbar=no, location=no, scrollbars=no, width=450, height=150")
}
</script>
</head>
<center>
<body bgcolor="FFFFFF" text="#000000" link="#000000" alink="#000000" vlink="#000000">
<center>
<table width="100%" border="1" cellspacing="0" cellpadding="0" height="95%">
<P ALIGN="top">
<tr><td width="15%">
<p>
<?
// List categories...
if ( $cat ) {
$sql = "SELECT parentcategoryid from category WHERE categoryid = $cat " ;
}
$sql = "SELECT categoryid, name FROM category WHERE parentcategoryid = categoryid" ;
echo "<table width=\" 15%\" ><tr><td><font face=\" Arial, Helvetica, sans-serif\" size=\" 2\" ><a href=\" main.php?cat=$categoryid \" ><b>$categoryname </b></a></font><br>" ; if ( ( $categoryid == $cat ) || ( $categoryid == $parent ) ) {
$subsql = "SELECT categoryid, name FROM category WHERE parentcategoryid = $categoryid AND categoryid != parentcategoryid" ;
$subcategoryid = @ mysql_result ( $subresult , $j , "categoryid" ) ; echo "</td></tr><tr><td><li><font face=\" Arial, Helvetica, sans-serif\" size=\" 2\" ><a href=\" main.php?cat=$subcategoryid \" >$subcategoryname </a></font><br></td></tr></table>" ; }
}
}
?>
</p>
</td><td>
<?
// List products belonging to this category...
$sql = "SELECT product.* from productcategory, product WHERE productcategory.categoryid = $cat AND product.productid = productcategory.productid" ;
<TABLE BORDER=\" 0\" width=\" 100%\" BORDERCOLOR=\" #000000\" CELLPADDING=\" 2\" CELLSPACING=\" 0\" >
<TR>
<TD BGCOLOR=\" #3399CC\" width=\" 30%\" ><a href=\" main.php?cat=$productid \" >$productname </A></TD>
<TD BGCOLOR=\" #3399CC\" width=\" 50%\" >$inhoud </TD>
<td bgcolor=\" #3399CC\" width=\" 20%\" >Koop!</TD>
</TR>
</TABLE>
" ;
}
?>
</tr></td>
</td>
</tr>
</table>
</center>
</body></html>
er staat ook php in maar dat moet je maar ff negeren
ReneeJ - 21/01/2006 14:50
HTML interesse
Ik zie zowieso al twee keer <html> en <head> en <body> staan.. weet niet waarom dit is
ReneeJ - 21/01/2006 15:07
HTML interesse
in regel 19 staat
<table width="100%" border="1" cellspacing="0" cellpadding="0" height="95%">
verander eens in
<table valign="top" width="100%" border="1" cellspacing="0" cellpadding="0" height="95%">
webstab - 21/01/2006 16:13 (laatste wijziging 21/01/2006 16:13)
PHP ver gevorderde
Ik snap je vraag niet. Wat moet er naar het midden? Wat moet naar links?
<td align="left"> // links uitlijnen
<td align="center"> // centreren
<td valign="top"> // boven in de tabel
<td valign="middle"> // midden in de tabel [verticaal gezien]
< td align= "left" > // links uitlijnen
< td align= "center" > // centreren
< td valign= "top" > // boven in de tabel
< td valign= "middle" > // midden in de tabel [verticaal gezien]
pim1991 - 21/01/2006 16:17 (laatste wijziging 21/01/2006 16:25)
PHP interesse
kijk het moet bovenaan de tabel
maar niks werkt. top werkt ook niet.
ik weet niet wat er aan de hand is...
en eigenlijk is dat niet het ergste. het ergste is dat hij eerst alles in 1 tabel zet. kijk maar eens:
http://www.coll...en/webshop /
hij zet eerst alles in 1 tabel.
als ik nu nog een categorie erbij doet dan zet hij weer alles in 1 tabel en is het niet meer leesbaar
riekele - 21/01/2006 16:25
PHP beginner
<table width="100%" border="1" cellspacing="0" cellpadding="0" height="95%">
<P ALIGN="top">
<tr><td width="15%">
<p>
< table width= "100%" border= "1" cellspacing= "0" cellpadding= "0" height= "95%" >
< P ALIGN= "top" >
< tr>< td width= "15%" >
< p>
verrander dat is in:
<table width="100%" border="1" cellspacing="0" cellpadding="0" height="95%">
<tr><td width="15%" valign="top">
<p>
< table width= "100%" border= "1" cellspacing= "0" cellpadding= "0" height= "95%" >
< tr>< td width= "15%" valign= "top" >
< p>
webstab - 21/01/2006 16:58
PHP ver gevorderde
<html>
<head>
<title>Widdershoven BV shop</title>
<script language="JavaScript">
function buyItem(itemno)
{
window.open("buy.php?"+itemno,"_blank","toolbar=no, location=no, scrollbars=no, width=450, height=150")
}
</script>
<script language="JavaScript">
function info(nr)
{
window.open("info.php?"+nr,"_blank","toolbar=no, location=no, scrollbars=no, width=500, height=200")
}
</script>
</head>
<body bgcolor="green">
<center>
<table border="0" height="95%" width="95%" bgcolor="#66CC66">
<tr height="100%">
<td align="center">
<table border="0" height="95%" width="95%" bgcolor="#66CC66">
<tr height="17%">
<td>
<table border="0" width="90%">
<tr>
<td width="65%" height="60">
<img src="images\logo.gif" border="0">
</td>
<td height="60">
</td>
</tr>
</table>
</td>
</tr>
<tr height="1%">
<td>
<table border="0" width="100%" background="images/a1.PNG">
<tr>
<td width="20%">
Log uit!
</td>
<td width="20%">
Profiel
</td>
<td width="20%">
Leveranciers
</td>
<td width="20%">
Zoeken
</td>
<td width="20%">
<img src="images\cart.gif"> Winkelwagen
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" valign="top" border="1" cellspacing="0" cellpadding="0" height="95%">
<tr>
<td width="15%" valign="top">
<p>
<font face="Arial, Helvetica, sans-serif" size="2"><a href="main.php?cat=1">Software</a></font><br><font face="Arial, Helvetica, sans-serif" size="2"><a href="main.php?cat=5">test</a></font><br>
</p>
<p>
<table width="100%" border="1" cellspacing="0" cellpadding="5" bordercolor="#FFCCCC">
<tr>
<td height="28" valign="top">
<form method="post" action="" name="shoppingcart">
<font face="Arial, Helvetica, sans-serif" size="2"><a href="basket.php">Your shopping cart</a>:</font><br>
<input type="text" name="total" size="4" value="0"> $
</form>
</td>
</tr>
<tr>
<td>
<font face="Arial, Helvetica, sans-serif" size="2"><a href="checkout.php">To check out</a>!</font>
</td>
</tr>
</table>
</p>
</td>
<td valign="top">
</td>
<td valign="top">
<TABLE BORDER="1" valign="top" width="100%" BORDERCOLOR="black" CELLPADDING="2" CELLSPACING="0">
<TR>
<TD BGCOLOR="blue" width="30%">Produktnaam</TD>
<TD BGCOLOR="blue" width="4%"> </TD>
<TD BGCOLOR="blue" width="45%">eenheid</TD>
<td bgcolor="blue" width="20%" height="10"> </TD>
</TR>
</TABLE>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
< html>
< head>
< title> Widdershoven BV shop</ title>
<script language = "JavaScript" >
function buyItem( itemno)
{
window. open( "buy.php?" + itemno, "_blank" , "toolbar=no, location=no, scrollbars=no, width=450, height=150" )
}
</script>
<script language = "JavaScript" >
function info( nr)
{
window. open( "info.php?" + nr, "_blank" , "toolbar=no, location=no, scrollbars=no, width=500, height=200" )
}
</script>
</ head>
< body bgcolor= "green" >
< center>
< table border= "0" height= "95%" width= "95%" bgcolor= "#66CC66" >
< tr height= "100%" >
< td align= "center" >
< table border= "0" height= "95%" width= "95%" bgcolor= "#66CC66" >
< tr height= "17%" >
< td>
< table border= "0" width= "90%" >
< tr>
< td width= "65%" height= "60" >
< img src= "images\logo.gif" border= "0" >
</ td>
< td height= "60" >
</ td>
</ tr>
</ table>
</ td>
</ tr>
< tr height= "1%" >
< td>
< table border= "0" width= "100%" background= "images/a1.PNG" >
< tr>
< td width= "20%" >
</ td>
< td width= "20%" >
Profiel
</ td>
< td width= "20%" >
Leveranciers
</ td>
< td width= "20%" >
Zoeken
</ td>
< td width= "20%" >
< img src= "images\cart.gif" > Winkelwagen
</ td>
</ tr>
</ table>
</ td>
</ tr>
< tr>
< td>
< table width= "100%" valign= "top" border= "1" cellspacing= "0" cellpadding= "0" height= "95%" >
< tr>
< td width= "15%" valign= "top" >
< p>
< font face= "Arial, Helvetica, sans-serif" size= "2" >< a href= "main.php?cat=1" > Software</ a></ font>< br>< font face= "Arial, Helvetica, sans-serif" size= "2" >< a href= "main.php?cat=5" > test</ a></ font>< br>
</ p>
< p>
< table width= "100%" border= "1" cellspacing= "0" cellpadding= "5" bordercolor= "#FFCCCC" >
< tr>
< td height= "28" valign= "top" >
< form method= "post" action= "" name= "shoppingcart" >
< font face= "Arial, Helvetica, sans-serif" size= "2" >< a href= "basket.php" > Your shopping cart</ a>:</ font>< br>
< input type= "text" name= "total" size= "4" value= "0" > $
</ form>
</ td>
</ tr>
< tr>
< td>
< font face= "Arial, Helvetica, sans-serif" size= "2" >< a href= "checkout.php" > To check out</ a>!</ font>
</ td>
</ tr>
</ table>
</ p>
</ td>
< td valign= "top" >
</ td>
< td valign= "top" >
< TABLE BORDER= "1" valign= "top" width= "100%" BORDERCOLOR= "black" CELLPADDING= "2" CELLSPACING= "0" >
< TR>
< TD BGCOLOR= "blue" width= "30%" > Produktnaam</ TD>
< TD BGCOLOR= "blue" width= "4%" >& nbsp;</ TD>
< TD BGCOLOR= "blue" width= "45%" > eenheid</ TD>
< td bgcolor= "blue" width= "20%" height= "10" >& nbsp;</ TD>
</ TR>
</ TABLE>
</ td>
</ tr>
</ table>
</ td>
</ tr>
</ table>
</ td>
</ tr>
</ table>
</ body>
</ html>
1. Als je met spaties werkt is het veel duidelijker
2. Als je met php files include dan moet je in uw body telkens opnieuw starten. Er begint ineens een nieuwe body-tag na een </td>?
3. Lees de tutorial over tabellen eens door.
Hetgeen wat ik heb bewerkt is niet de mooiste oplossing, maar ik denk wel dat dat jouw probleem oplost. Ik ga niet heel de pagina opnieuw maken voor u.
Gesponsorde links
Dit onderwerp is gesloten .