How to change table font size in LaTeX?

In this tutorial, You will learn how to set the font size of a table in LaTeX with multiple methods.

The available font sizes for text in LaTeX are \small, \footnotesize, \scriptsize, \tiny, \large, \Large, \LARGE, \huge, and \Huge.

all font sizes.

You can use any of them for a specific font size. You have to use the font size command before the tabular environment.

\documentclass{article}
\begin{document}

\begin{table}[h]
    \centering
    \small % Set font size here
    \begin{tabular}{|c|c|c|c|}
    \hline
     \textbf{Head-1} & \textbf{Head-2} & \textbf{Head-3} & \textbf{Head-4}\\
    \hline
    Text & Text & Text & Text\\
    \hline
    Text & Text & Text & Text\\
    \hline
    Text & Text & Text & Text\\
    \hline
    Text & Text & Text & Text\\
    \hline
    Text & Text & Text & Text\\
    \hline
    \end{tabular}
    \caption{Font size \textbackslash \texttt{small}}
\end{table}

\end{document}

Output:

small font in table.
Let’s try font size \scriptsize.

\documentclass{article}
\begin{document}

\begin{table}[h]
    \centering
    \scriptsize % Set font size here
    \begin{tabular}{|c|c|c|c|}
    \hline
     \textbf{Head-1} & \textbf{Head-2} & \textbf{Head-3} & \textbf{Head-4}\\
    \hline
    Text & Text & Text & Text\\
    \hline
    Text & Text & Text & Text\\
    \hline
    Text & Text & Text & Text\\
    \hline
    Text & Text & Text & Text\\
    \hline
    Text & Text & Text & Text\\
    \hline
    \end{tabular}
    \caption{Font size \textbackslash \texttt{scriptsize}}
\end{table}

\end{document}

Output:
scriptsize font size in table.

Change the font size of a table including the caption

Although the table font size was changed but, you can notice the caption was not changed. If you would like to change the caption’s font size, you have to use the caption package.

This package provides the \captionsetup{font=<font-size>} command you can add this command before the tabular.

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

\begin{table}[h]
    \centering
    \captionsetup{font=scriptsize} % set font size of caption
    \tiny % Set font size of table here
    \begin{tabular}{|c|c|c|c|}
    \hline
     \textbf{Head-1} & \textbf{Head-2} & \textbf{Head-3} & \textbf{Head-4}\\
    \hline
    Text & Text & Text & Text\\
    \hline
    Text & Text & Text & Text\\
    \hline
    Text & Text & Text & Text\\
    \hline
    Text & Text & Text & Text\\
    \hline
    Text & Text & Text & Text\\
    \hline
    \end{tabular}
    \caption{Font size Table: \texttt{tiny} \& Cap: \texttt{scriptsize}}
\end{table}

\end{document}

Output:

set font size in table with caption.

 

Change the font size of a table with caption globally

You can also set the font size of a table including caption for all tables of your document (globally). In this case, you have to use the floatrow and caption package, then you can use \floatsetup[table]{font=<font-size>} for table and \captionsetup{font=<font-size>} for caption.

\documentclass{article}
\usepackage{floatrow}
\usepackage{caption}
\floatsetup[table]{font=small}
\captionsetup{font=small}

\begin{document}

\begin{table}[h]
    \centering
    \begin{tabular}{|c|c|c|c|}
    \hline
     \textbf{Head-1} & \textbf{Head-2} & \textbf{Head-3} & \textbf{Head-4}\\
    \hline
    Text & Text & Text & Text\\
    \hline
    Text & Text & Text & Text\\
    \hline
    Text & Text & Text & Text\\
    \hline
    Text & Text & Text & Text\\
    \hline
    Text & Text & Text & Text\\
    \hline
    \end{tabular}
    \caption{Font size \texttt{small}}
\end{table}

\end{document}

Output:

small font in table with acaption.

Leave a Reply

Your email address will not be published. Required fields are marked *