[Tex/LaTex] Move left aligned table caption synchronous with table

tables

I did left aligned table capture but can't move capture with table in right direction. Try implement shift command after \begin{table} and
\leftskip=2cm moves table but not the caption. While \hspace{2cm} moves nothing.
How can I move caption with their table?

\begin{table}[h] 
\leftskip=2cm
\caption{Table caption}
\label{tab:time}
\begin{tabular}{|c|c|c|} \hline
Borders expand: & 1,0-1,4   & size FRT \\\hline
Apodization:    & 0,25-0,30 & size FRT \\\hline
Border extrude: & 0,25-0,50 & size FRT \\\hline
\end{tabular}
\end{table}

enter image description here


I can do as follow:

\begin{table}[h]
 \leftskip=2.5em
 \caption{%
    \leftskip=2.5em 
    The table caption that longer than table so will hiphenated}
\label{tab:time}
\begin{tabular}{|c......

but I want use single shift command at beginning of table environment.

Just now comment \@parboxrestore in \@caption defenition and can use single shift command.

\long\def\@caption#1[#2]#3{%
  \par
  \addcontentsline{\csname ext@#1\endcsname}{#1}%
    {\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}%
  \begingroup
    %\@parboxrestore
    \if@minipage
      \@setminipage
    \fi
    \normalsize
    \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
  \endgroup}

How safe this comment action?

Best Answer

Use threeparttable (measures the table width) and caption (for the left alignment of the caption):

     \documentclass{article}
    \usepackage[utf8]{inputenc}%
    \usepackage{fourier, erewhon}
\usepackage[showframe]{geometry}
\usepackage{caption, threeparttable}

\begin{document}

\begin{table}[h]
  \leftskip=2cm
  \begin{threeparttable}
    \captionsetup{singlelinecheck=off, skip=4pt}
    \caption{Table caption}
    \label{tab:time}
    \begin{tabular}{|c|c|c|} \hline
      Borders expand: & 1,0-1,4 & size FRT \\\hline
      Apodization: & 0,25-0,30 & size FRT \\\hline
      Border extrude: & 0,25-0,50 & size FRT \\\hline
    \end{tabular}
  \end{threeparttable}
\end{table}

\end{document} 

enter image description here

If you want a long caption go to the right margin, instead of being of the same width of the table, you can use the adjustwidth environment from changepage:

 \documentclass{article}
\usepackage[utf8]{inputenc}%
\usepackage{fourier, erewhon}
\usepackage[showframe]{geometry}
\usepackage{caption}
\usepackage{changepage}

\begin{document}


\begin{table}[!htbp]
  \begin{adjustwidth}{2cm}{0cm}
    \captionsetup{singlelinecheck=off, skip=4pt, width =\dimexpr \textwidth-2cm\relax}%
    \caption{Table caption. A very very long caption. A very very long caption. A very very long caption. A very very long caption}
    \label{tab:time}
    \begin{tabular}{|c|c|c|} \hline
      Borders expand: & 1,0-1,4 & size FRT \\\hline
      Apodization: & 0,25-0,30 & size FRT \\\hline
      Border extrude: & 0,25-0,50 & size FRT \\\hline
    \end{tabular}
  \end{adjustwidth}
\end{table}

\end{document} 

enter image description here