Problema tabella: troppo lunga in orizzontale

  • Creatore
    Topic
  • #105773
    Up
    0
    Down
    ::


    Salve, ho riprodotto la seguente tabella sia usando l’ambiente tabular che tabularx , con le relative varianti.
    Purtroppo, però, l’effetto finale orizzontale non è dei migliori, in quanto non leggibile (troppo piccolo), oppure tutto il testo troppo ammassato.

    Vorrei evitare di mettere tale tabella in verticale.

    Qualche suggerimento?

    Grazie 🙂
    [attachment=1577]dronivietnam.png[/attachment]

    Attachments:
    You must be logged in to view attached files.
Visualizzazione 5 filoni di risposte
  • Autore
    Risposte
    • #105774
      Up
      0
      Down
      ::

      golden_boy” post=105846Salve, ho riprodotto la seguente tabella sia usando l’ambiente tabular che tabularx , con le relative varianti.
      Purtroppo, però, l’effetto finale orizzontale non è dei migliori, in quanto non leggibile (troppo piccolo), oppure tutto il testo troppo ammassato.

      Vorrei evitare di mettere tale tabella in verticale.

      Qualche suggerimento?

      Grazie 🙂
      [attachment=1577]dronivietnam.png[/attachment]

      Sì, quello di farci vedere i codici con cui hai fatto le prove.

      Ciao
      Tommaso

    • #105775
      Up
      0
      Down
      ::


      Ecco il codice

      `

      \documentclass[11pt,a4paper,oneside]{book}

      \usepackage[T1]{fontenc}
      \usepackage[utf8]{inputenc}
      \usepackage[italian]{babel}

      \usepackage{tabularx}

      \begin{document}

      \begin{center}
      \begin{tabularx}{\textwidth}{|X|X|X|X|X|}
      \hline
      Date & Interceptor Type/Weapon Type & Interceptor Unit & Drone Type & USAF Unit/Remarks
      \\
      \hline
      3/04/1966 & MiG-21/AA-2 Atoll (K-13) Air to Air Missile & 921st Fighter Regiment (FR) & Ryan Firebee AQM-34 series & 350th Strategic Reconnaissance Squadron (SRS), 100th Strategic Reconnaissance Wing (SRW)/This was the first U.S. drone downed by the NVAF.
      \\
      \hline
      3/05/1966 & MiG-21/AA-2 Atoll & 921st FR & AQM-34 & 350th SRS, 100th SRW
      \\
      \hline
      \end{tabularx}
      \end{center}

      \end{document}

      `

    • #105776
      Up
      0
      Down
      ::


      `
      \documentclass[a4paper]{article}

      \usepackage[T1]{fontenc}
      \usepackage[utf8]{inputenc}
      % \usepackage[italian]{babel} % it looks like you are writing in English!

      \usepackage{caption}
      \usepackage{tabularx}
      \usepackage{rotating}

      \captionsetup{
      tableposition = top,
      figureposition = bottom
      }
      \newcolumntype{Y}{>{\raggedright\arraybackslash}X}

      \begin{document}

      It’s better to use a sideways table, obviously floating:
      see Table~\ref{tab:drones}. Using a smaller font (say, \verb”\small”)
      might also help.

      \begin{sidewaystable}
      \caption{Drones}
      \label{tab:drones}
      \begin{tabularx}{\textwidth}{|l|Y|Y|Y|Y|}
      \hline
      Date & Interceptor Type/Weapon Type & Interceptor Unit & Drone Type & USAF Unit/Remarks
      \\
      \hline
      3/04/1966 & MiG-21/AA-2 Atoll (K-13) Air to Air Missile & 921st Fighter Regiment (FR) & Ryan Firebee AQM-34 series & 350th Strategic Reconnaissance Squadron (SRS), 100th Strategic Reconnaissance Wing (SRW)/This was the first U.S. drone downed by the NVAF.
      \\
      \hline
      3/05/1966 & MiG-21/AA-2 Atoll & 921st FR & AQM-34 & 350th SRS, 100th SRW
      \\
      \hline
      \end{tabularx}
      \end{sidewaystable}

      In your sample code, you didn’t make use of the \textsf{booktabs} package.
      I heartily disagree, but, as you can see, I~respected your choice.

      \end{document}
      `

      Modifica: Volevo poi aggiungere questo commento (chiedo scusa, ma ci ho messo più di mezz’ora per ritrovarlo).

      Ciao.


      Gustavo

    • #105777
      Up
      0
      Down
      ::


      Così in verticale era facile da realizzare 😀

    • #105778
      Up
      0
      Down
      ::


      Il succo del mio suggerimento era di definire un`\newcolumntype{Y}{>{\raggedright\arraybackslash}X}`e poi di usare tale nuovo specificatore di colonna [tt]Y[/tt] per evitare i messaggi di [tt]Underfull \hbox[/tt]. Se non si vuole assolutamente comporre la tabella in verticale, si può anche lasciare che essa invada parte dei margini, oltre a usare un carattere più piccolo:
      `
      \documentclass[a4paper]{article}

      \usepackage[T1]{fontenc}
      \usepackage[utf8]{inputenc}
      % \usepackage[italian]{babel} % it looks like you are writing in English!

      \usepackage{caption}
      \usepackage{tabularx}
      \usepackage{rotating}

      \captionsetup{
      tableposition = top,
      figureposition = bottom
      }
      \newcolumntype{Y}{>{\raggedright\arraybackslash}X}

      \begin{document}

      \section{First version: sideways table}

      It’s better to use a sideways table, obviously floating:
      see Table~\ref{tab:drones-sw}.
      Using a smaller font (say, \verb”\small”) might also help.

      \begin{sidewaystable}
      \caption{Drones}
      \label{tab:drones-sw}
      \begin{tabularx}{\textwidth}{|l|Y|Y|Y|Y|}
      \hline
      Date & Interceptor Type/Weapon Type & Interceptor Unit & Drone Type & USAF Unit/Remarks
      \\
      \hline
      3/04/1966 & MiG-21/AA-2 Atoll (K-13) Air to Air Missile & 921st Fighter Regiment (FR) & Ryan Firebee AQM-34 series & 350th Strategic Reconnaissance Squadron (SRS), 100th Strategic Reconnaissance Wing (SRW)/This was the first U.S. drone downed by the NVAF.
      \\
      \hline
      3/05/1966 & MiG-21/AA-2 Atoll & 921st FR & AQM-34 & 350th SRS, 100th SRW
      \\
      \hline
      \end{tabularx}
      \end{sidewaystable}

      In your sample code, you didn’t make use of the \textsf{booktabs} package.
      I heartily disagree, but, as you can see, I~respected your choice.

      \section{Second version: upright table}

      If you insist on having the table set in its ordinary, upright orientation,
      look, instead, at Table~\ref{tab:drones-ur}. At least, we are not getting
      any \verb”Underfull \hbox” warning!

      \begin{table}[htp]
      \caption{Drones}
      \label{tab:drones-ur}
      \footnotesize % reduce font size
      \centerline{% let the table protrude into the margins
      \begin{tabularx}{.8\paperwidth}{|l|Y|Y|Y|Y|}
      \hline
      Date & Interceptor Type/Weapon Type & Interceptor Unit & Drone Type & USAF Unit/Remarks
      \\
      \hline
      3/04/1966 & MiG-21/AA-2 Atoll (K-13) Air to Air Missile & 921st Fighter Regiment (FR) & Ryan Firebee AQM-34 series & 350th Strategic Reconnaissance Squadron (SRS), 100th Strategic Reconnaissance Wing (SRW)/This was the first U.S. drone downed by the NVAF.
      \\
      \hline
      3/05/1966 & MiG-21/AA-2 Atoll & 921st FR & AQM-34 & 350th SRS, 100th SRW
      \\
      \hline
      \end{tabularx}%
      } % end of \centerline
      \end{table}

      \end{document}
      `
      È chiaro che, alla fin delle fini, qualche compromesso bisogna accettarlo: un autobus parcheggiato nello spazio di un’autovettura normale semplicemente non ci sta.

      Ciao.


      Gustavo

    • #105779
      Up
      0
      Down
      ::

      golden_boy” post=105855Così in verticale era facile da realizzare 😀

      È facile da realizzare anche in orizzontale 😀

      La lettura di una buona guida ti soccorrerà.

      Ciao
      Tommaso

Visualizzazione 5 filoni di risposte
  • Devi essere connesso per rispondere a questo topic.

Go to top