Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    Troncare parola troppo lunga

    Ciao a tutti
    Chiedo un aiuto in quanto ho gia sbattuto la testa troppo su questo argomento.
    Ho bisogno che all'interno delle tabella, le parole troppo lunghe, vengono troncate.
    Vi posto parte del codice

    echo "<tr><th align=center style=border-styleutset bgcolor=#999999>ORA INIZIO</th>
    <th align=center style=border-styleutset bgcolor=#999999>ORA FINE</th>
    <th align=center style=border-styleutset bgcolor=#999999>CLIENTE</th>
    <th align=center style=border-styleutset bgcolor=#999999>DESCRIZIONE</th>
    <th align=center style=border-styleutset bgcolor=#999999>IMPATTO</th>
    <th align=center style=border-styleutset bgcolor=#999999>CAUSA</th>
    <th align=center style=border-styleutset bgcolor=#999999>GRUPPO</br>RISOLUTORE</th>
    <th align=center style=border-styleutset bgcolor=#999999>SOLUZIONE</th>
    </tr>";
    while ($row = mysql_fetch_array($result))
    {
    echo " <a href=\"view.php?id=$row[id]\"> </a> <tr>

    <td align=center bgcolor=#ffffff width='80'> $row[oraapertura]</td>
    <td align=center bgcolor=#ffffff width='80'> $row[orachiusura]</td>
    <td align=center bgcolor=#ffffff> $row[cliente] </td>
    <td align=center bgcolor=#ffffff><div style=' height:50px; overflow-y:auto; ' > $row[descrizione] </td>
    <td align=center bgcolor=#ffffff><div style=' height:50px; overflow-y:auto; '> $row[impatto] </td>
    <td align=center bgcolor=#ffffff><div style=' height:50px; overflow-y:auto; '> $row[causa] </td>
    <td align=center bgcolor=#ffffff><div style=' height:50px; overflow-y:auto; '> $row[supporto] </td>
    <td align=center bgcolor=#ffffff><div style=' height:50px; overflow-y:auto;'> $row[soluzione] </td>
    <td align=center >";

    }
    echo "</table>";


    Ho visto da diverse parti ma noto che la cosa risulta molto difficile da eseguire. Nel caso non si potesse è possibile far vedere il . (punto) come carattere da poter metter a capo?
    Ma questo è meglio fare un'altro post.
    Spero che aver spiegato il mio problema.
    Grazie in anticipo

  2. #2
    Ti suggerisco di iniziare leggendo il manuale ufficiale:

    http://www.php.net/wordwrap

    Con particolare attenzione al 4 parametro ed ai commenti degli utenti.

  3. #3
    Utente di HTML.it
    Registrato dal
    Jun 2008
    Messaggi
    38
    Guarda se substr può fare al caso tuo.
    substr($stringa, $indicedipartenza, $numerodilettereoltreilqualetroncare)

    gp

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.