# [Tex/LaTex] Variable description table

longtabletables

I want to create a table with variable description. First, I the table shown below has really small font and text is not wrapped. And second, I need to let the table continue in the next page. How can I fix these problems?

\begin{table}[!htbp]
\fontsize{11}{9}\selectfont
\caption{Description of Variables used in this Study}
\label{table: vardescription}
\begin{center}
\begin{tabular}{ l | p{13cm} }
\hline \hline

\textbf{\normalsize Code} & \textbf{\normalsize Definition and source}  \\
\hline

\textbf{exportsgr} & Exports of goods and services (annual \% growth) retrieved from World Bank. \\ \hline

\textbf{importsgr} & Imports of goods and services (annual \% growth) retrieved from World Bank.\\ \hline

\textbf{gr\_tot} & Terms of trade change over previous year (in \%).  Data for terms of trade are collected from theglobaleconomy.com  and Kaminsky and Reinhart online database. Since variables have two different base years, the base year for both was changed to 2000 to have the same base year. And then the change is calculated as below.

$$gr\_tot_{i,t} = (\frac{tot_{i,t}- tot_{i,t-1}}{tot_{i,t-1}})100$$
\\ \hline

\toprule
\end{tabular}
\end{center}

\end{table}


Here are two different examples of your table using xltabular to enable page breaking and to make sure the table fits into the textwidth:

\documentclass{article}

\usepackage{xltabular}
\usepackage{booktabs}
\begin{document}

\begin{xltabular}{\linewidth}{ l | X }
\caption{Description of Variables used in this Study}
\label{table: vardescription}\\
\hline \hline

\textbf{\normalsize Code} & \textbf{\normalsize Definition and source}  \\
\hline
\hline \hline

\textbf{\normalsize Code} & \textbf{\normalsize Definition and source}  \\
\hline

\textbf{exportsgr} & Exports of goods and services (annual \% growth) retrieved from World Bank. \\ \hline

\textbf{importsgr} & Imports of goods and services (annual \% growth) retrieved from World Bank.\\ \hline

\textbf{gr\_tot} & Terms of trade change over previous year (in \%).  Data for terms of trade are collected from theglobaleconomy.com  and Kaminsky and Reinhart online database. Since variables have two different base years, the base year for both was changed to 2000 to have the same base year. And then the change is calculated as below.

$$gr\_tot_{i,t} = (\frac{tot_{i,t}- tot_{i,t-1}}{tot_{i,t-1}})100$$
\\ \hline
\textbf{exportsgr} & Exports of goods and services (annual \% growth) retrieved from World Bank. \\ \hline

\textbf{importsgr} & Imports of goods and services (annual \% growth) retrieved from World Bank.\\ \hline

\textbf{gr\_tot} & Terms of trade change over previous year (in \%).  Data for terms of trade are collected from theglobaleconomy.com  and Kaminsky and Reinhart online database. Since variables have two different base years, the base year for both was changed to 2000 to have the same base year. And then the change is calculated as below.

$$gr\_tot_{i,t} = (\frac{tot_{i,t}- tot_{i,t-1}}{tot_{i,t-1}})100$$
\\ \hline
\textbf{exportsgr} & Exports of goods and services (annual \% growth) retrieved from World Bank. \\ \hline

\textbf{importsgr} & Imports of goods and services (annual \% growth) retrieved from World Bank.\\ \hline

\textbf{gr\_tot} & Terms of trade change over previous year (in \%).  Data for terms of trade are collected from theglobaleconomy.com  and Kaminsky and Reinhart online database. Since variables have two different base years, the base year for both was changed to 2000 to have the same base year. And then the change is calculated as below.

$$gr\_tot_{i,t} = (\frac{tot_{i,t}- tot_{i,t-1}}{tot_{i,t-1}})100$$
\\ \hline
\textbf{exportsgr} & Exports of goods and services (annual \% growth) retrieved from World Bank. \\ \hline

\textbf{importsgr} & Imports of goods and services (annual \% growth) retrieved from World Bank.\\ \hline

\textbf{gr\_tot} & Terms of trade change over previous year (in \%).  Data for terms of trade are collected from theglobaleconomy.com  and Kaminsky and Reinhart online database. Since variables have two different base years, the base year for both was changed to 2000 to have the same base year. And then the change is calculated as below.

$$gr\_tot_{i,t} = (\frac{tot_{i,t}- tot_{i,t-1}}{tot_{i,t-1}})100$$
\\ \hline

\end{xltabular}

\newpage

\begin{xltabular}{\linewidth}{ l  X }
\caption{Description of Variables used in this Study}
\label{table: vardescription}\\
\toprule
Code & Definition and source  \\
\midrule
\toprule
Code & Definition and source  \\
\midrule
\bottomrule
\endfoot

exportsgr & Exports of goods and services (annual \% growth) retrieved from World Bank. \\ \addlinespace

importsgr & Imports of goods and services (annual \% growth) retrieved from World Bank.\\   \addlinespace

gr\_tot & Terms of trade change over previous year (in \%).  Data for terms of trade are collected from theglobaleconomy.com  and Kaminsky and Reinhart online database. Since variables have two different base years, the base year for both was changed to 2000 to have the same base year. And then the change is calculated as below.

$$gr\_tot_{i,t} = (\frac{tot_{i,t}- tot_{i,t-1}}{tot_{i,t-1}})100$$

exportsgr & Exports of goods and services (annual \% growth) retrieved from World Bank. \\  \addlinespace

importsgr & Imports of goods and services (annual \% growth) retrieved from World Bank.\\ \addlinespace

gr\_tot & Terms of trade change over previous year (in \%).  Data for terms of trade are collected from theglobaleconomy.com  and Kaminsky and Reinhart online database. Since variables have two different base years, the base year for both was changed to 2000 to have the same base year. And then the change is calculated as below.

$$gr\_tot_{i,t} = (\frac{tot_{i,t}- tot_{i,t-1}}{tot_{i,t-1}})100$$

exportsgr & Exports of goods and services (annual \% growth) retrieved from World Bank. \\ \addlinespace

importsgr & Imports of goods and services (annual \% growth) retrieved from World Bank.\\  \addlinespace

gr\_tot & Terms of trade change over previous year (in \%).  Data for terms of trade are collected from theglobaleconomy.com  and Kaminsky and Reinhart online database. Since variables have two different base years, the base year for both was changed to 2000 to have the same base year. And then the change is calculated as below.

$$gr\_tot_{i,t} = (\frac{tot_{i,t}- tot_{i,t-1}}{tot_{i,t-1}})100$$
\\

exportsgr & Exports of goods and services (annual \% growth) retrieved from World Bank. \\  \addlinespace

importsgr & Imports of goods and services (annual \% growth) retrieved from World Bank.\\  \addlinespace

gr\_tot & Terms of trade change over previous year (in \%).  Data for terms of trade are collected from theglobaleconomy.com  and Kaminsky and Reinhart online database. Since variables have two different base years, the base year for both was changed to 2000 to have the same base year. And then the change is calculated as below.

$$gr\_tot_{i,t} = (\frac{tot_{i,t}- tot_{i,t-1}}{tot_{i,t-1}})100$$
\\

\end{xltabular}

\end{document}