Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 13
  1. #1

    Celle vuote di una tabella senza bordo

    Salve,
    ho il problema che i bordi delle celle vuote di una tabella non mi vengono visualizzate, come si può fare per visualizzarle ?

    Questo lo script che origina la tabella:

    <?
    include("config.inc.php");
    include("stile.php");
    ?>




    <?
    echo("<table border=\"1\">

    <tr>
    <td valign=\"top\" style=\"color:red\">N</td>
    <td valign=\"top\" style=\"color:red\">AUTORE</td>
    <td valign=\"top\" style=\"color:red\">TITOLO</td>
    <td valign=\"top\" align=\"center\" style=\"color:red\">ANNO</td>
    </tr>");

    $db = mysql_connect($db_host, $db_user, $db_password);
    if ($db == FALSE)
    die ("Errore nella connessione. Verificare i parametri nel file config.inc.php");
    mysql_select_db($db_name, $db)
    or die ("Errore nella selezione del database. Verificare i parametri nel file config.inc.php");

    if (!isset($start) OR $start<0)
    $start=0;
    $step = 100;

    $query = "SELECT `N`,`AUTORE`,`GENERE`,`TITOLO`,`DESCRIZIONE`,`EDIT ORE`,`ANNO`,`PREZZO` FROM `articoli` ORDER BY N LIMIT $start,$step";

    $result = mysql_query($query, $db);
    while ($row = mysql_fetch_array($result))

    {echo("<tr><td valign=\"top\">$row[N]</td>
    <td valign=\"top\" align=\"left\">$row[AUTORE]</td>
    <td valign=\"top\" align=\"left\"><a href=\"view.php?N=$row[N]\" title=\"Dettagli\">$row[TITOLO]</a></td>
    <td valign=\"top\">$row[ANNO]</td>
    </tr>"); }

    echo("</table>");
    ?>




    <table width="100%" border="1">

    <tr>
    <td width="10%" align="left">
    <?
    if ($start>0)
    { $start_back = $start - $step;
    echo "<a href=all.php?start=$start_back>precedenti</a>";
    }
    ?>
    </td>

    <?
    $query = "SELECT count(*) AS tot FROM articoli";
    $result = mysql_query($query, $db);
    $row = mysql_fetch_array($result);
    $pages = intval(($row[tot]-1) / $step)+1;
    ?>

    <td width="80%" align="center">
    <?
    for ($i=0; $i<$pages AND $i<50; $i++)
    { $start_page = $i * $step;
    echo "<a href=all.php?start=$start_page>" . ($i+1) . "</a> ";
    }
    ?>
    </td>

    <td width="10%" align="right">
    <?
    if ($start + $step < $row[tot])
    { $start_next = $start + $step;
    echo "<a href=all.php?start=$start_next>successivi</a>";
    }
    ?>
    </td>
    </tr>

    </table>

    <p align="center">
    <?
    echo "<a href=\"#\">Torna su</a>";
    ?>
    </p>


    -----------------------------------------
    e questo il link:
    http://www.libriantichicavallero.com/all.php

    Grazie
    Pier Mario

  2. #2
    Utente di HTML.it L'avatar di nicola75ss
    Registrato dal
    Nov 2004
    Messaggi
    12,922
    Se la cella non contiene niente ci metti
    & nbsp; tutto attaccato.

  3. #3
    ho provato ad es così ma non va:
    if ($row[ANNO] == "")
    {echo "&nbsp";}
    else
    {echo "<td valign=\"top\">$row[ANNO]</td>";}

  4. #4
    Utente di HTML.it L'avatar di zoseppe
    Registrato dal
    Jan 2005
    Messaggi
    306
    Codice PHP:
    echo "<td valign=\"top\">$row[ANNO]</td>"
    e lo fai per tutti i campi

  5. #5
    come sempre devo ringraziarVi tutti.-
    Ciao

  6. #6
    però perche qui non va ?

    <table width="100%" border="1">

    <tr>
    <td width="10%" align="left">
    <?
    if ($start>0)
    { $start_back = $start - $step;
    echo "<a href=all.php?start=$start_back>precedenti</a>";
    }
    ?>
    </td>

    <?
    $query = "SELECT count(*) AS tot FROM articoli";
    $result = mysql_query($query, $db);
    $row = mysql_fetch_array($result);
    $pages = intval(($row[tot]-1) / $step)+1;
    ?>

    <td width="80%" align="center">
    <?
    for ($i=0; $i<$pages AND $i<50; $i++)
    { $start_page = $i * $step;
    echo "<a href=all.php?start=$start_page>" . ($i+1) . "</a> ";
    }
    ?>
    </td>

    <td width="10%" align="right">
    <?
    if ($start + $step < $row[tot])
    { $start_next = $start + $step;
    echo "<a href=all.php?start=$start_next>successivi</a>";
    }
    ?>
    </td>
    </tr>

    </table>

  7. #7
    Utente di HTML.it L'avatar di zoseppe
    Registrato dal
    Jan 2005
    Messaggi
    306
    che problema ti da?

  8. #8
    nella prima e nell'ultima pagina creata non vengono visualizzati i bordi rispettivamente della cella "precedenti" e "successivi".
    Non capisco il perché.

  9. #9
    Utente di HTML.it L'avatar di zoseppe
    Registrato dal
    Jan 2005
    Messaggi
    306
    hai messo &nbsp anche li??? :

  10. #10
    si dopo la parola precedenti e prima della parola successivi, ma non andava ed allora ora l'ho tolto

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.