Re: Inserire Immagini in ambiente tabular

#14584
DMW
    Up
    0
    Down
    ::


    Ecco la soluzione datami dal Prof. Beccari:

    Preferibilmente nel preambolo, cioè prima di \begin{document} scrivi questo codice
    `\makeatletter
    \newcommand*\ttoprule{\hrule\@height0pt\@width0pt\@depth-1ex}
    \newcommand*\ctoprule{\hrule\@height0pt\@width0pt\@depth.8ex}
    \let\btoprule\ctoprule
    \let\bbotrule\ctoprule
    \let\cbotrule\bbotrule
    \let\tbotrule\bbotrule
    \newcommand*{\tabularimage}[3]{\parbox[#1]{#2}{%
    \csname#1toprule\endcsname%
    \includegraphics[width=#2]{#3}\par
    \csname#1botrule\endcsname}}
    \makeatother`

    ed eccoti un esempio:

    `
    \begin{tabular}{llp{125pt}}
    \hline
    Immagine & Descrizione\\
    \hline
    testo & \tabularimage[t]{120pt}{cheese}& testo\\
    \hline
    \end{tabular}`

    il parametro t definisce il posizionamento della figura (anzi del testo).
    Infatti prova a mettere c (oppure b) al posto di t.

    Ciao

    Andrea

    [MOD]Ho aggiunto \makeatletter e \makeatother, senza quelli il codice non funziona, a meno che non lo si metta in un file .sty. Enrico[/MOD]

    Go to top