1

Is it possible to place the center of table to 0.75 widthtext? I would like to center the table not to the center of page width but with respect to the 3/4 of page width.

\begin{table}
\begin{minipage}{0.75\linewidth}
\caption[]{cap}\label{l}
\begin{flushleft}
\begin{tabular}{lccc}
\hline\hline\noalign{\smallskip}
a&b&c&d\\
\noalign{\smallskip}\hline\noalign{\smallskip}
a&b&c&d\\
\noalign{\smallskip}\hline\noalign{\smallskip}
\end{tabular}
\end{flushleft}
\end{minipage}
\end{table}
  • 1
    Center the tabular environment in a minipage of width 0.75\textwidth? – Mico Aug 28 at 11:26
  • What is your intention with the flushleft-environment? – Lupino Aug 28 at 12:30
  • BTW, there are lots of ways to center stuff (boxes), such as \centering and \makebox[<width>][c]{...}. Note that some are implemented using trivlist and add extra space before and after. – John Kormylo Aug 28 at 13:05
1

You can center the tabular environment like any other text using the center-environment:

\documentclass{article}
\usepackage{showframe}

\begin{document}
\noindent\begin{minipage}{.75\linewidth}
  \begin{center}
    \begin{tabular}{lccc}
      \hline\hline\noalign{\smallskip}
      a&b&c&d\\
      \noalign{\smallskip}\hline\noalign{\smallskip}
      a&b&c&d\\
      \noalign{\smallskip}\hline\noalign{\smallskip}
    \end{tabular}
  \end{center}
\end{minipage}
\end{document}

Note: the \noindent in front of \begin{minipage} is only needed, when the minipage appears as is after a text paragraph.

  • Thank you very much – Lukáš Altman Aug 28 at 12:42
  • @LukášAltman - This solution is not correct, as it doesn't provide a \noindent directive before \begin{minipage}. – Mico Aug 28 at 12:44
  • 1
    @Mico since we are right behind \begin{document} it is unnecessary, as would it be if the whole construct is within the table environment… But i edited my example accordingly, just in case. – Lupino Aug 28 at 13:26
2

Assuming the natural width of the tabular environment is less than 0.75\textwidth, you may achieve your formatting objective by centering the tabular environment in a minipage of width \0.75\textwidth- .

enter image description here

\documentclass{article}
\usepackage{showframe} % show framelnes around text block
\usepackage{tabularx}  % for tabularx environment 
\begin{document}
\noindent
\begin{minipage}{0.75\textwidth}
\centering
\begin{tabular}{|*{6}{c|}}
\hline
A & B & C & D & E & F \\
\hline
\end{tabular}
\end{minipage}%
\begin{tabularx}{0.25\textwidth}{|>{\centering\arraybackslash}X|}
\hline
abcdefhij\\
\hline
\end{tabularx}

\noindent
\begin{tabularx}{0.25\textwidth}{|>{\centering\arraybackslash}X|}
\hline
abcdefhij\\
\hline
\end{tabularx}%
\begin{tabularx}{0.25\textwidth}{|>{\centering\arraybackslash}X|}
\hline
abcdefhij\\
\hline
\end{tabularx}%
\begin{tabularx}{0.25\textwidth}{|>{\centering\arraybackslash}X|}
\hline
abcdefhij\\
\hline
\end{tabularx}%
\begin{tabularx}{0.25\textwidth}{|>{\centering\arraybackslash}X|}
\hline
abcdefhij\\
\hline
\end{tabularx}
\end{document}
  • Thank you and in case of flushleft please? I added this case to my question. It is not in center of half page after compilation – Lukáš Altman Aug 28 at 11:58
  • @LukášAltman - Have you tried inserting a \centering directive after \begin{flushleft}? – Mico Aug 28 at 12:43

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.