0

I have a table like this: enter image description here

How can I align Caption with left of table not paper?!

And I want to stretch the table a little.

\documentclass{article}

\begin{document}
\begin{table}[h!]
\centering
 \caption{Dimensions of simulated tissue containing a malignant tumor, all dimensions are in millimeters}
 \label{tabdimension}
\begin{tabular}{ccccc}
\hline
X & Y & Z & D& R \\
\hline
120 & 60 & 25 & 12 &10 \\
\hline
\end{tabular}
\end{table}
\end{document}
1

Use threeparttable. In addition, part of the caption can go at the bottom of the table, as a tablenote. Using the rule of booktabs wil add some vertical padding around the rules:

\documentclass{article}
\usepackage{array, threeparttable, booktabs,  caption}

\begin{document}

\begin{table}[h!]
  \centering\captionsetup{font=footnotesize}
  \begin{threeparttable}
    \caption{Dimensions of simulated tissue containing a malignant tumor}
    \label{tabdimension}
    \begin{tabular}{ccccc}
      \toprule
      X   & Y  & Z  & D  & R  \\
      \midrule
      120 & 60 & 25 & 12 & 10 \\
      \bottomrule
      \addlinespace
    \end{tabular}
    \begin{tablenotes}[flushleft]
      \footnotesize
      \item All dimensions are in mm
    \end{tablenotes}
  \end{threeparttable}
\end{table}

\end{document} 

enter image description here

If you prefer to have a two-line caption, you can set the caption width with \captionsetup, but can't use threeparttable In this case, a work around consists in adding a new row to the table, with this code:

\begin{table}[h!]
  \centering
  \captionsetup{font=footnotesize, width= 47mm}
    \caption{Dimensions of simulated tissue containing a malignant tumor}
    \label{tabdimension}
    \begin{tabular}{ccccc}
      \toprule
      X   & Y  & Z  & D  & R  \\
      \midrule
      120 & 60 & 25 & 12 & 10 \\
      \bottomrule
      \addlinespace
      \multicolumn{5}{@{}l}{\footnotesize All dimensions are in mm}
    \end{tabular}
\end{table}

enter image description here

  • Thank you. how can i increase the table width a little? – H.H Jul 17 '16 at 17:15
  • The table width depends on the table contents. You can choose a fixed width, while keeping the cell contents centred with \begin{tabular}{*{5}{>{\centering p{some width}}}. The specifier p may be replaced with m` or b, depending on the vertical alignment inside cells. You also may choose the overall width of the table with the \tabularx environment. – Bernard Jul 17 '16 at 17:37

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.