1

Based on feedback, here is the updated code. The text now wraps, but it still is formatted to the left instead of center.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{float}
\usepackage{setspace}
\usepackage{caption}
\usepackage{subcaption}
\usepackage[bottom]{footmisc}
\usepackage{geometry}
\usepackage{array}
\usepackage{enotez}
\let\footnote=\endnote
\geometry{
 a4paper,
 total={170mm,257mm},
 left=20mm,
 top=20mm,
 }
\newcolumntype{M}[1]{%
    >{\raggedright\arraybackslash\hspace{0pt}}
    m{#1}
}
\doublespacing

\begin{document}

\begin{table}
\centering
\caption{Financial Literacy Questions (Big Three)}
\begin{tabular}{M{10cm}}
\hline
\hline
1) Suppose you had \$100 in a savings account and the interest rate was 2\% per year. After 5 years, how much do you think you would have in the account if you left the money to grow? \\
2) Imagine that the interest rate on your savings account was 1\% per year and inflation was 2\% per year. After 1 year, how much would you be able to buy with the money in this account? \\
3) Please tell me whether this statement is true or false. ``Buying a single company's stock usually provides a safer return than a stock mutual fund." \\
\hline
\hline
\end{tabular}
\raggedright
\begin{singlespace}
** indicates the correct answer \\
\end{singlespace}
\end{table}

I want to include a table that is centered on the page and has text inside of 1 column that wraps. I have tried the following:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{float}
\usepackage{setspace}
\usepackage{caption}
\usepackage{subcaption}
\usepackage[bottom]{footmisc}
\usepackage{geometry}
\usepackage{enotez}
\let\footnote=\endnote
 \geometry{
 a4paper,
 total={170mm,257mm},
 left=20mm,
 top=20mm,
 }
\begin{table}[H]
\centering
\caption{Financial Literacy Questions (Big Three)}
\begin{tabular}{l}
\hline
\hline
1) Suppose you had \$100 in a savings account and the interest rate was 2\% per year. After 5 years, how much do you think you would have in the account if you left the money to grow? \\
2) Imagine that the interest rate on your savings account was 1\% per year and inflation was 2\% per year. After 1 year, how much would you be able to buy with the money in this account? \\
3) Please tell me whether this statement is true or false. ``Buying a single company's stock usually provides a safer return than a stock mutual fund." \\
\hline
\hline
\end{tabular}
\end{table}

I then tried the exact same thing, but with a fixed column width. This just moved the whole table to the left. Help?

1
  • was the answer useful -- if so please accept the answer and upvote
    – js bibra
    Apr 29, 2020 at 6:20

2 Answers 2

1

You switch from \centering to \raggedright before ending the paragraph that the tabular is in. Put a blank line or \par between \end{tabular} and \raggedright.

Maybe I should recommend threeparttable.sty.

0

You can experiment with the length 10cm

enter image description here

\documentclass{article}

\usepackage{array}%<-----------------------in preamble

\newcolumntype{M}[1]{%
    >{\raggedright\arraybackslash\hspace{0pt}}
    m{#1}
}
\begin{document}
\begin{table}
     \centering
    \caption{Financial Literacy Questions (Big Three)}
    \begin{tabular}{M{10cm}}
        \hline
        \hline
        1) Suppose you had \$100 in a savings account and the interest rate was 2\% per year. After 5 years, how much do you think you would have in the account if you left the money to grow? \\
        2) Imagine that the interest rate on your savings account was 1\% per year and inflation was 2\% per year. After 1 year, how much would you be able to buy with the money in this account? \\
        3) Please tell me whether this statement is true or false. ``Buying a single company's stock usually provides a safer return than a stock mutual fund." \\
        \hline
        \hline
    \end{tabular}
\end{table}
\end{document}
2
  • That works for wrapping the text, but it still keeps the table to the far left of the page. I am trying to figure out how to have the table centered as well.
    – Ashley
    Apr 29, 2020 at 2:18
  • you have not posted your complete code so cannot guess -- table is centred for me after compiling -- in case u found the answer helpful please upvote -- i have edited the answer to show my complete code--please compare it with your code and see the difference
    – js bibra
    Apr 29, 2020 at 2:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .