TransWikia.com

Differences across borders in table

TeX - LaTeX Asked by Luca Giangregorio on February 12, 2021

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!

One Answer

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}{>{RaggedRighthspace{0pt}}X}

begin{document}
begin{frame}
    begin{table}
    scriptsizelinespread{0.84}selectfont
    setlengthtabcolsep{4pt}
begin{tabularx}{linewidth}{@{} 
                >{hsize=0.8hsize}L
                >{hsize=0.75hsize}L
                >{hsize=1.25hsize}L
                >{hsize=1.2hsize}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.

Answered by Zarko on February 12, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP