Tabellenchaos

Status
Nicht offen für weitere Antworten.

speicher

Erfahrenes Mitglied
Hallo, vielleicht kann mir jemand ja helfen und verraten, warum bei dieser Tabelle das Element, was als <tfoot> eigentlich unterhalb der einzelnen Tabellenfelder stehen sollte, ganz oben steht.

Vielen Dank!


HTML:
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<style type="text/css">
<!--
a.z:link {text-decoration:none; color: #FFFFFF;}
a.z:visited {text-decoration:none;color: #FFFFFF;}
a.z:active {text-decoration:none; color: #FFFFFF;}
a.z:hover {text-decoration:none; color: #0000FF;}

a:link {text-decoration:none; color: #000000;}
a:visited {text-decoration:none;color: #FF8000;}
a:active {text-decoration:none; color: #000000;}
a:hover {text-decoration:underline; color: #0000FF;}
span { color: #000000; }


-->
</style>


</head><body>
<?php
extract($HTTP_GET_VARS);
extract($HTTP_POST_VARS);
include("functions.php");

$max = $_index;

if(isset($_GET['nu']))
{
$nu=$_GET['nu'];
$x=(($nu-1)*3);
}
else
{
 $x=0;
}

$seite=bcdiv($max,3,0);
if(bcmod($max,3)!= 0){$seite++;}



?>

<div style="position: absolute; top: 54; left: 32; width: 100%; height: 100%">
<TABLE style="FONT-WEIGHT: bold; FONT-SIZE: 10px; VERTICAL-ALIGN: top; WIDTH: 300px; COLOR: #000080; FONT-STYLE: normal; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none" cellSpacing=0 cellPadding=0 bgcolor=#FFFFFF >

<TH colspan=1>
<B><FONT color=#000000><h2>News-Ticker</h2></FONT></B>
<?php
$datum = date("d.m.Y");
echo '<font face="Arial" color=#000000 size="1">'.$datum.'</font>';
?>
</TH>
<tr>

<?php


for ($x; $x < ($max+1); $x++) {

    $y=$x+1;
    $aktuell = round(bcdiv($x,3,1));
    if (!($y > $max)){
    echo '<Td width="100px" height="60px"><a href="' . print_r($items[$y][link], true) . '"target="News" class="z"><span>['.$y.'/'.($max).'] '.$items[$y][title].'<p></b></span></a></Td></tr><tr>';
    }

    if (bcmod($y,3)==0)
    {
       echo '<tfoot coolspan=1>';

     if($aktuell > 1 || $aktuell == $seite)
       {
       echo '<a href="news2.php?nu='.($aktuell-1).'"><<</a>';
       }
     echo ("\t $aktuell / $seite \t");
     if($aktuell < $seite )
                 {
                       echo '<a href="news2.php?nu='.($aktuell+1).'">>></a>';
                 }
      echo '</tfoot>';

      break;
     }
}
?>
</tr>
</TABLE>
</body></html>
 
Die Aufgabe ist unlösbar da hier keiner weiß wie es aussehen soll. Aufgrund das deine Variabeln gut (vorsicht ironie) sind kann ich auch keiner vorstellen was es damit zu tun hat.

Aber ich versuche trotzdem dir zu helfen. Alllgemein gilt:

mit <table> machst du eine Tabelle auf.
mit <tr> machste eine spallte auf.
mit <td> machst du eine Zelle in einer vorher geöffneten spalte offen
mit </td> machst du die vorher geöffnete Zelle wieder zu
mit </tr> machst du die vorher geöffnete Spalte wieder zu
mit </table> machst du die vorher geöffnete Tabelle wieder zu

den th Tag brauch man eigentlich net der macht genau das gleiche wie td nur das alles dortdrin fett geschrieben wird.
mann kann oder besser gesagt solllte nur in Zellen schreiben.ich markiere dir nich ein paar Fehler
PHP:
//table aufgemacht gut
<TABLE style="FONT-WEIGHT: bold; FONT-SIZE: 10px; VERTICAL-ALIGN: top; WIDTH: 300px; COLOR: #000080; FONT-STYLE: normal; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none" cellSpacing=0 cellPadding=0 bgcolor=#FFFFFF >

//hier th aufgemacht fehlt aber ein tr und dann ein td

<TH colspan=1>
<B><FONT color=#000000><h2>News-Ticker</h2></FONT></B>
<?php
$datum = date("d.m.Y");
echo '<font face="Arial" color=#000000 size="1">'.$datum.'</font>';
?>

//dann wieder td zu und dann tr

</TH>

//tr auf jetzt machst du es richtig warum oben nicht

<tr>

<?php


for ($x; $x < ($max+1); $x++) {

    $y=$x+1;
    $aktuell = round(bcdiv($x,3,1));
    if (!($y > $max)){

// td auf gut und am ende alles wieder zu und wieder tr auf das heißt am ende wird eine neue spalte aufgemacht
    
echo '<Td width="100px" height="60px"><a href="' . print_r($items[$y][link], true) . '"target="News" class="z"><span>['.$y.'/'.($max).'] '.$items[$y][title].'<p></b></span></a></Td></tr><tr>';
    }

    if (bcmod($y,3)==0)
    {
  
//tfoot kenn ich net wahrscheinlich falsch oder nach php10 standart ;-]  wenn du hier was ausgeben willst musst du noch ein td aufmachen weil du ja oben ein tr aufgemacht hast     

echo '<tfoot coolspan=1>';

     if($aktuell > 1 || $aktuell == $seite)
       {
       echo '<a href="news2.php?nu='.($aktuell-1).'"><<</a>';
       }
     echo ("\t $aktuell / $seite \t");
     if($aktuell < $seite )
                 {
                       echo '<a href="news2.php?nu='.($aktuell+1).'">>></a>';
                 }
      echo '</tfoot>';

      break;
     }
}
?>

//es fehlt ein td zu ansonsten richtig zugemacht mit tr und table 
</tr>
</TABLE>
 
Hallo vielen Dank...nun geht es. Ich denke es lag bestimmt an dem <th>

<tfoot> habe ich nur so genannt, um die Problemzone zu markieren.

Ich habe nun <th> und <tfoot> jeweils durch <tr><td> ersetzt und entsprechend wieder geschlossen und alles sieht so aus, wie es sollte.

Danke noch einmal für die schnelle Hilfe!
 
Status
Nicht offen für weitere Antworten.
Zurück