I've just started using sharelatex and I read many manuals and previous questions about long tables yet my long table doesn't fit to my document. it is too wide and exit the margins. it doesn't rotate either. I would be glad if you could help me because I don't know where else to look for a solution. That's the text:
\begin{sidewaytable}
\begin{longtable}{|c|c|c|c|}
\hline
Variable &Type/ denomination &Source&Employed in:
\hline
Compulsory voting
&Dummy=1 if voting compulsory in country i at time t &Self-created based on IDEA information
&(2a), (3a)
\hline
Voting age &Minimum age to vote in country i at time t &IDEA&
\hline
Urban population
&\% population living in cities &WB &(2a), (3a)
\hline
Gini coefficient&Gini coefficient estimate &WB&(2a)
\hline
High\_Ten &\% of country i’s GNI held by richest 10\% of population &WB
\hline
Patents &Patent application from residents of country i at time t &WB
\hline
Oda &Net ODA received per capita &WB &(2a)
\hline
Literacy &Literacy rate of population above 15 &WB
\hline
Life &Life expectancy at birth, in years &WB&
\hline
Net exports&Exports in current US \$ - Imports in current US \$& Self-created based on WB data &(2a), (3a)
\hline
Inflation &CPI index, growth rate in country i from t-1 to t, relative to time t &WB&
\hline
Agriculture value added&As a \% of GDP &WB
\hline
C02 emissions&In tons per capita&WB
\hline
Domestic credit &To the private sector, as a \% of GDP &WB\\
\label{tab2}
\end{longtable}
\end{sidewaytable}
longtable
inside asidewaystable
env. cannot work – Mico Apr 5 '18 at 17:02