LaTeX-tabel te breed. Hoe maak je het passend?

Ik ben net begonnen met het leren van latex en nu probeer ik een tabel te maken. Dit is mijn code:

\begin{table}
\caption{Top Scorers}
\begin{tabular}{ l l }
    \hline
    \bf Goals & \bf Players\\
    \hline
    4 & First Last, First Last, First Last, First Last\\
    3 & First Last\\
    2 & First Last\\
    1 & First Last, First Last, First Last, First Last, First Last, First Last, First Last, First Last, First Last, First Last, First Last, First Last, First Last\\
    \hline
\end{tabular}
\end{table}

Het probleem is dat de tabel breder is dan de pagina. Ik hoopte dat het automatisch op de pagina zou passen zoals normale tekst, maar dat gebeurde niet. Hoe vertel ik latex dat de tafel op de pagina moet passen?


Antwoord 1, autoriteit 100%

Gebruik p{width}kolomspecificatie: b.v. \begin{tabular}{ l p{10cm} }plaatst de inhoud van de kolom in een parbox van 10 cm breed en de tekst wordt correct opgedeeld in meerdere regels, zoals in een normale alinea.

U kunt ook de omgeving tabular*gebruiken om de breedte voor de hele tabel op te geven.


Antwoord 2, autoriteit 61%

Je moet hele kolommen nemen onder resizebox. Deze code werkte voor mij

\begin{table}[htbp]
\caption{Sample Table.}\label{tab1}
\resizebox{\columnwidth}{!}{\begin{tabular}{|l|l|l|l|l|}
\hline
URL &  First Time Visit & Last Time Visit & URL Counts & Value\\
\hline
https://web.facebook.com/ & 1521241972 & 1522351859 & 177 & 56640\\
http://localhost/phpmyadmin/ & 1518413861 & 1522075694 & 24 & 39312\\
https://mail.google.com/mail/u/ & 1516596003 & 1522352010 & 36 & 33264\\
https://github.com/shawon100& 1517215489 & 1522352266 & 37 & 27528\\
https://www.youtube.com/ & 1517229227 & 1521978502 & 24 & 14792\\
\hline
\end{tabular}}
\end{table}

Antwoord 3, autoriteit 11%

Je kunt deze opties ook gebruiken, ofwel \footnotesizeof \tiny. Dit zou echt helpen bij het plaatsen van grote tafels.

\begin{table}[htbp]
\footnotesize
\caption{Information on making the table size small}
\label{table:table1}
\begin{tabular}{ll}
    \toprule
    S.No       & HMD           \\
    \midrule
    1          & HTC Vive \\
    2          & HTC Vive Pro   \\
    \bottomrule
\end{tabular}
\end{table}

Other episodes