latex table text smaller code example

Example 1: overleaf table size length of text

% Makes table with = text width

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\noindent\hrulefill

\smallskip\noindent
\resizebox{\linewidth}{!}{%
\begin{tabular}{r|lll}
\multicolumn{1}{r}{}
& \multicolumn{1}{l}{Heading 1}
& \multicolumn{1}{l}{Heading 2}
& \multicolumn{1}{l}{Heading 3} \\ \cline{2-4}
Row 1 & Cell 1,1 & Cell 1,2 & Cell 1,3 \\
Row 2 & Cell 2,1 & Cell 2,2 & Cell 2,3
\end{tabular}}

\end{document}

Example 2: font size table latex

\documentclass{article}
\usepackage{graphicx}
\begin{document}

\begin{table}
\resizebox{\textwidth}{!}{%
  \begin{tabular}{cc}
    Knuth & Lamport
  \end{tabular}}
\end{table}

\end{document}

Tags:

Misc Example