0

I'm struggling with a very simple table in beamer. The table is the following:

\begin{table}

\begin{tabular}{ >{\Large}c | >{\Large}c  | >{\Large}c  | >{\Large}c } \hline \\ 
    \textbf{Author} & \textbf{Field} & \textbf{Question} & \textbf{Method}  \\ [3ex]  

\hline \hline 
\\ 
M. B\"{o}hme et al. (2018) & Migration & Predict international migration with online search keywords & GTI trends \\  [7ex]

D. Garcia et al. (2018) & Gender inequality & Using Facebook advertising data to infer gender inequality & Fb marketing API \\  [7ex]

L. Timothy et al. (2019) & Health & Is income inequality harmful for health? & Geospatial Big-Data \\  [7ex]

R. Chetty (2020) & Intergenerational mobility & New insights on social mobility in the US & Geospatial information + administrative tax records \\  [7ex]

M. J{\ae}ger \& E.H. Blaab{\ae}k (2020) & Education inequality & Inequality in learning opportunities &  Access and takeout materials from public libraries \\  [7ex]

S. Su at al. (2017) & Health & Socio-economic status and access to healthy food & Geo-big Data on four types of mobility \\  [7ex]

J.L. Toole et al. (2015) & Macro-economics predictions & Unemployment tracking and predictions & Mobile-phone data \\  [7ex]

P. Brown \& M. Souto-Otero (2018) & O-E-D relation & Investigating the E-D relation in UK & Job Adverts from Burning-Glass Labour Insight \\  [7ex]

L Sloan et al. (2015) & Social-class analysis & Obtaining socio-demographic characteristics from Big-Data & Twitter users' description \\ [3ex] 

\hline 

  \end{tabular}
\end{table} 

However, I get the following table: enter image description here

Why the borders of the columns right to the first one are different and do not close the border?

Thanks for your help!

  • there is no need to apply \Large to each column it is simpler and will give better spacing to use a single \Large before the tabular – David Carlisle Nov 29 '20 at 18:10
  • 1
    your vertical lines are broken as you have \hline \hline \\ do not use \\ after \hline, you are making an empty row that just has one cell and then ends early so only the first cell has a vertical rule. – David Carlisle Nov 29 '20 at 18:12
  • 1
    Since you mention beamer in your question: I highly doubt this table is ever goint to fit onto a single frame, let alone in a \large fonz size. – leandriis Nov 29 '20 at 18:31
1

Your table is too big for a4 paper, so the situation is much worse in the beamer frame. You need to restrict its width to \textwidth and enable to break text in cells into more line. For this is handy to use tabularx table:

\documentclass{beamer}
\usepackage{ragged2e}
\usepackage{booktabs, tabularx}
\newcolumntype{L}{>{\RaggedRight\hspace{0pt}}X}

\begin{document}
\begin{frame}
    \begin{table}
    \scriptsize\linespread{0.84}\selectfont
    \setlength\tabcolsep{4pt}
\begin{tabularx}{\linewidth}{@{} 
                >{\hsize=0.8\hsize}L
                >{\hsize=0.75\hsize}L
                >{\hsize=1.25\hsize}L
                >{\hsize=1.2\hsize}L @{}}
    \toprule
\textbf{Author} & \textbf{Field} & \textbf{Question} & \textbf{Method}  \\
    \midrule
M. B\"{o}hme et al. (2018) & Migration & Predict international migration with online search keywords & GTI trends \\  
    \addlinespace[2pt]
D. Garcia et al. (2018) & Gender inequality & Using Facebook advertising data to infer gender inequality & Fb marketing API \\   
    \addlinespace[2pt]
L. Timothy et al. (2019) & Health & Is income inequality harmful for health? & Geospatial Big-Data \\  
    \addlinespace[2pt]
R. Chetty (2020) & Intergenerational mobility & New insights on social mobility in the US & Geospatial information + administrative tax records \\   
    \addlinespace[2pt]
M. J{\ae}ger \& E.H. Blaab{\ae}k (2020) & Education inequality & Inequality in learning opportunities &  Access and takeout materials from public libraries \\ 
    \addlinespace[2pt]
S. Su at al. (2017) & Health & Socio-economic status and access to healthy food & Geo-big Data on four types of mobility \\  
    \addlinespace[2pt]
J.L. Toole et al. (2015) & Macro-economics predictions & Unemployment tracking and predictions & Mobile-phone data \\  
    \addlinespace[2pt]
P. Brown \& M. Souto-Otero (2018) & O-E-D relation & Investigating the E-D relation in UK & Job Adverts from Burning-Glass Labour Insight \\ 
    \addlinespace[2pt]
L Sloan et al. (2015) & Social-class analysis & Obtaining socio-demographic characteristics from Big-Data & Twitter users' description \\
    \bottomrule
\end{tabularx}
    \end{table} 
\end{frame}
\end{document}

enter image description here

If you like add to frame a frame title or table caption, you need further reduce table font size or extend table over two slide. For example with use of the xltabular, however, its features is not the same as at other documentclases.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.