Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 13
  1. #1
    Utente di HTML.it
    Registrato dal
    Nov 2001
    Messaggi
    274

    allineamento testo tabella

    Salve, ho questo code:

    codice:
    function draw_gallery($id)
    {
      global $gallery_dir;
    
      $mysql = new DB;
    
      $mysql->query("SELECT `id`, `event`, `comment`, DATE_FORMAT(tdate,'%d/%m/%Y') AS `fdate`, `place`, `directory`  FROM `gallery` WHERE `id`='$id' LIMIT 1");
      $mysql->next_record();
    
      $id             = $mysql->f('id');
      $event          = $mysql->f('event');
      $date           = $mysql->f('fdate');
      $place          = $mysql->f('place');
      $comment        = $mysql->f('comment');
      $directory      = $mysql->f('directory');
    
      $html_comments  = 'Data evento: '.$date.'
    ';
      $html_comments .= 'Luogo: '.$place.'
    ';
      $html_comments .= 'Numero foto: '.count_photo_gallery($id).'
    ';
      $html_comments .= '<hr>';
      $html_comments .= 'Commento:
    ';
      $html_comments .= $comment . '
    ';
    ?>
    <div align="center">
    <table width="90%" border="0" cellspacing="0" cellpadding="0">
     <tr colspan="3">
      <td align="left" width="35" height="25" background="images/gallery/bg.gif">[img]images/gallery/left.gif[/img]</td>
      <td align="right" height="25" background="images/gallery/bg.gif"><?=$event?></td>
      <td align="right" height="12" heigth="25" background="images/gallery/bg.gif">[img]images/gallery/right.gif[/img]</td>
     </tr>
     <tr>
      <td></td>
      <td></td>
      <td></td>
     </tr>
     <tr>
      <td align="left">[img]<?=$gallery_dir?>/<?=$directory?>/<?=get_random_pict($id)?>[/img]</td>
      <td align="left"><?=$html_comments?></td>
     </tr>
    </table>
    </div>
    <?
    }
    http://www.baricity.it/index.php?mod=gallery

    come potete vedere da quest'url, il testo al lato della foto è disallineato perchè di lunghezza diversa, avete idee su come posso risolvere?
    Progeny

  2. #2
    Utente di HTML.it
    Registrato dal
    Nov 2001
    Messaggi
    274
    up
    Progeny

  3. #3
    VVoVe: VVoVe: VVoVe: VVoVe:

    <tr colspan=3> ??????? che vuol dire? il colspan e' un attributo del tag <td>

    colspan indica quante celle unire orizzontalmente e rowsan indica quante celle (non righe) unire verticalmente quindi
    <tr colspan="3">
    <td align="left" width="35" height="25" background="images/gallery/bg.gif">[img]images/gallery/left.gif[/img]</td>
    <td align="right" height="25" background="images/gallery/bg.gif"><?=$event?></td>
    <td align="right" height="12" heigth="25" background="images/gallery/bg.gif">[img]images/gallery/right.gif[/img]</td>
    </tr>
    non ha senso

    fai cosi

    <table width="90%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td align="left" width="35" height="25" background="images/gallery/bg.gif">[img]images/gallery/left.gif[/img]</td>
    <td align="right" height="25" background="images/gallery/bg.gif"><?=$event?></td>
    <td align="right" height="12" heigth="25" background="images/gallery/bg.gif">[img]images/gallery/right.gif[/img]</td>
    </tr>
    <tr>
    <td></td>
    <td></td>
    <td></td>
    </tr>
    <tr>
    <td align="left" colspan=2>[img]<?=$gallery_dir?>/<?=$directory?>/<?=get_random_pict($id)?>[/img]</td>
    <td align="left"><?=$html_comments?></td>
    </tr>
    </table>
    http://www.mcganass.com

  4. #4
    Utente di HTML.it
    Registrato dal
    Nov 2001
    Messaggi
    274
    ho fatto come hai detto ma ancora non vedo i due testi affianco alla foto allineati
    Progeny

  5. #5
    si scusa
    errore mio

    <table width="90%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td align="left" width="35" height="25" background="images/gallery/bg.gif">[img]images/gallery/left.gif[/img]</td>
    <td align="right" height="25" background="images/gallery/bg.gif"><?=$event?></td>
    <td align="right" height="12" heigth="25" background="images/gallery/bg.gif">[img]images/gallery/right.gif[/img]</td>
    </tr>
    <tr>
    <td> </td>
    <td> </td>
    <td> </td>
    </tr>
    <tr>
    <td colspan=2>
    <table cellspacing=0 cellpadding=0 width=100% border=0>
    <tr>
    <td align="left" width=100>[img]<?=$gallery_dir?>/<?=$directory?>/<?=get_random_pict($id)?>[/img]</td>
    <td align="left"><?=$html_comments?></td>
    </tr>
    <table>
    </td>
    </tr>
    </table>



    colspan=3 ovviamente ho sabglaito a scrivere
    http://www.mcganass.com

  6. #6
    Utente di HTML.it
    Registrato dal
    Nov 2001
    Messaggi
    274
    codice:
    <div align="center">
    <table width="90%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td align="left" width="35" height="25" background="images/gallery/bg.gif">[img]images/gallery/left.gif[/img]</td>
    <td align="right" height="25" background="images/gallery/bg.gif"><?=$event?></td>
    <td align="right" height="12" heigth="25" background="images/gallery/bg.gif">[img]images/gallery/right.gif[/img]</td>
    </tr>
    <tr>
    <td> </td>
    <td> </td>
    <td> </td>
    </tr>
    <tr>
    <td colspan=2>
    <table cellspacing=0 cellpadding=0 width=100% border=0>
    <tr>
    <td align="left" width=100>[img]thumbnail.php?id=<?=get_random_pict($id)?>[/img]</td>
    <td align="left"><?=$html_comments?></td>
    </tr>
    <table>
    </td>
    </tr>
    </table>
    </div>
    http://www.baricity.it/index.php?mod=gallery2
    Progeny

  7. #7
    <td colspan=3>
    http://www.mcganass.com

  8. #8
    Utente di HTML.it
    Registrato dal
    Nov 2001
    Messaggi
    274
    si vero, avevo fatto copy&paste, modificato, ma nulla ancora il link è sempre mod=gallery2
    Progeny

  9. #9
    prova a mettere border=1 alla tabella non ti risolve il problema ma serve a me per vedere che combina l'html...
    http://www.mcganass.com

  10. #10
    Utente di HTML.it
    Registrato dal
    Nov 2001
    Messaggi
    274
    fatto
    Progeny

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.