0

I have a problem with fitting two tables in my TEXSHOP File to the right size. Below I attached a screeshot, showing that the table is clearly too small to be visible. My code is the following:

\begin{table}[h]
\centering 
\begin{adjustbox}{max width=\textwidth}
\begin{tabular} {|| l | l ||}
\hline

\end{tabular}
\end{adjustbox}
\caption{Benefits of participatory sensing}
\label{benefits}
\end{table} 

enter image description here

Many Many thanks for your help, Hugo

  • replace l by p{4cm} or whatever column width you need and remove the adjustbox scaling. scaling tables should be an absolute final resort (and even then consider not doing it) – David Carlisle Mar 22 '16 at 10:47
  • 2
    Please give us some compilable code and put some text in your table. It is much easier to help then. – LaRiFaRi Mar 22 '16 at 11:57
2

Do not scale tables if not necessary. If you have that much text, you could also write it as an itemization or by using paragraphs or something alike.

In order to get the maximum width, I would recommend the package tabularx here:

% arara: pdflatex

\documentclass{article}
\usepackage{blindtext}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{ragged2e}
\usepackage{microtype}

\begin{document}    
\begin{table}
    \centering 
    \begin{tabularx}{\textwidth}{@{}l>{\RaggedRight}X@{}} % @{} takes away any horizontal spacing at the borders. Not beautiful, but gives you some more space. 
        \toprule
        bla bla blup & \blindtext\\
        \bottomrule
    \end{tabularx}
    \caption{Benefits of participatory sensing}\label{benefits}
\end{table} 
\setcounter{section}{3}
\setcounter{subsection}{2}
\setcounter{subsubsection}{2}
\subsubsection{Challenges or participatory sensing}
\blindtext
\end{document}

enter image description here

In case you want to tweak your first column to have the width of your desired definition, you should replace the l by p{<some dimension>}. In this case and if you like the columns to be set \RaggedRight as I did in my MWE above, you might want to load ragged2e as \usepackage[raggedrightboxes]{ragged2e}.

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.