1

I want to change the position of table caption to left, i'd appreciate if someone could help, enter image description here

\documentclass[12pt,a4paper]{article} 
\usepackage{caption} 
\captionsetup[table]{singlelinecheck=false}
\usepackage{adjustbox}
\captionsetup[table]{
    labelsep = newline,
    textfont = sc, 
    name = TABLE, 
    justification=justified,
    singlelinecheck=false,%%%%%%% a single line is centered by default
    labelsep=colon,%%%%%%
    skip = \medskipamount}
\begin{document}


\begin{table}
    \centering
    \caption{Variables and Definitions}\label{table:2}
    \begin{adjustbox}{center}
        \begin{tabular}{ l p{10.5cm} p{3cm}}
            \hline\hline   
            Variables &  Definition & Source \\  \hline\hline   
            POV    & Measured as Poverty Headcount ratio at \$ 2 a day           & WDI                    \\   
            PG     & Measured as Poverty gap at \$ 2 a day       & WDI                   \\  
            GINI   & Income Inequality, natural log of GINI coefficient  &  WDI     \\   \hline                              
            \hline\hline    
            \multicolumn{3}{l}{%
                \begin{minipage}{16cm}%
                    \tiny Note: $+$The World Bank, World Development Indicators (WDI). %
                \end{minipage}%
            }\\
        \end{tabular}
    \end{adjustbox}
\end{table}

\end{document}

  • BTW, you have two \captionsetup s (the first will be ignored). – John Kormylo Jan 22 '16 at 15:55
1

You don't need adjustboxfor this table, if you simply use the l specifier for the last column. It all can be done with the threeparttable and tablenotes environments. I also took the liberty to replace your \hlines with rules from the booktabs package, and add some vertical padding to the rows with \addlinespace from the same package:

\documentclass[12pt,a4paper]{article}
\usepackage[showframe]{geometry}
\usepackage{caption}
\captionsetup[table]{singlelinecheck=false}
\usepackage{adjustbox}
\captionsetup[table]{
labelsep = newline,
textfont = sc,
name = TABLE,
justification=justified,
singlelinecheck=false,%%%%%%% a single line is centered by default
labelsep=colon,%%%%%%
skip = \medskipamount}
\usepackage{booktabs, threeparttable}

\begin{document}

\begin{table}
  \centering
  \begin{threeparttable}[online]
    \caption{Variables and Definitions}\label{table:2}
    \begin{tabular}{lp{10.5cm}l}
      \toprule\midrule
      Variables & Definition & Source \\
      \midrule\midrule
      POV & Measured as Poverty Headcount ratio at \$ 2 a day & WDI \\
      \addlinespace
      PG & Measured as Poverty gap at \$ 2 a day & WDI \\
      \addlinespace
      GINI & Income Inequality, natural log of GINI coefficient & WDI \\
      \midrule \bottomrule
    \end{tabular}
    \begin{tablenotes}[online]\medskip
      \tiny \item[Note:] $+$The World Bank, World Development Indicators (WDI). %
    \end{tablenotes}
  \end{threeparttable}
\end{table}

\end{document} 

enter image description here

| improve this answer | |
  • @BernardThank you so much for your answer, actully i used adjustbox because this table doesn't fit on the page, i used the above code, the table is not in the centre. – Rizwan Jan 22 '16 at 15:32
  • Is it far from fitting the table width? You can play with various parameters (\tabcolsep, fontsize inside the table, &c.). As a last resort, you can use tabularx and set the table to textwidth. Could you post a representative example of your problems? – Bernard Jan 22 '16 at 16:46
1

The following uses How can I center a too wide table? for centering the table, and changepage's adjustwidth to make the appropriate room for the \caption to match the tabular layout. While The original layout suggested that the caption be moved over the width of the first column (which contains Variables as its widest entry). However, eyeballing it would have also sufficed.

enter image description here

\documentclass[a4paper]{article} 
\usepackage{caption,lipsum}
\usepackage{booktabs,changepage}

\captionsetup[table]{
    labelsep = newline,
    textfont = sc, 
    name = TABLE, 
    justification=justified,
    singlelinecheck=false,%%%%%%% a single line is centered by default
    labelsep=colon,%%%%%%
    skip = \medskipamount}

\begin{document}


\begin{table}
  \makeatletter
  \settowidth{\@tempdima}{Variables}%
  \addtolength{\@tempdima}{2\tabcolsep}%
  \begin{adjustwidth}{-\@tempdima}{\@tempdima}
    \caption{Variables and Definitions}
  \end{adjustwidth}
  \makeatother
  \makebox[\textwidth]{% https://tex.stackexchange.com/a/39436/5764
    \begin{tabular}{ l p{10.5cm} p{3cm}}
      \toprule
      Variables & Definition & Source \\
      \midrule
      POV       & Measured as Poverty Headcount ratio at \$ 2 a day  & WDI \\
      PG        & Measured as Poverty gap at \$ 2 a day              & WDI \\
      GINI      & Income Inequality, natural log of GINI coefficient & WDI \\
      \bottomrule
      \multicolumn{3}{l}{%
        \tiny Note: $+$The World Bank, World Development Indicators (WDI).%
      }
    \end{tabular}%
  }
\end{table}

\lipsum[1]

\end{document}

booktabs was added for pizzaz...

| improve this answer | |

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.