Si ponga il caso di una tabella come la seguente:
Se si vuole che l’ultimo <td>, cioè “testo lungo” occupi anche la terza casella in basso, bisogna usare colspan.
Ecco il risultato usando colspan e indicando che il <td> occupa 2 caselle:
La stessa cosa vale per rowspan, ma questo indica che occupa più di una riga, come nell’esempio:
<table border=1> <tr> <td>testo</td> <td>testo</td> <td>testo</td> </tr> <tr> <td>testo</td> <td>testo lungo</td> </tr> </table>
Se si vuole che l’ultimo <td>, cioè “testo lungo” occupi anche la terza casella in basso, bisogna usare colspan.
Ecco il risultato usando colspan e indicando che il <td> occupa 2 caselle:
<table border=1> <tr> <td>testo</td> <td>testo</td> <td>testo</td> </tr> <tr> <td>testo</td> <td colspan=2>testo lungo</td> </tr> </table>
La stessa cosa vale per rowspan, ma questo indica che occupa più di una riga, come nell’esempio:
<table border=1> <tr> <td>testo</td> <td>testo</td> <td>testo</td> </tr> <tr> <td rowspan= 2>testo</td> <td>testo</td> <td>testo</td> </tr> <tr> <td>testo</td> <td>testo</td> </tr> </table>
A cura di: Black Shadow