0

I am using Revtex 4 class but I have a problem with the alignment of the text in the table.

Here is my code, is there any way to center align all data with wrapping text if needed?

Note: it looks good in the article class...

Thank you.

\documentclass[fleqn,12pt,floatfix,superscriptaddress]{revtex4}
\usepackage{amsfonts}
\usepackage{amsmath} 
\usepackage{amssymb}
 \usepackage{tabularx,ragged2e,booktabs}
 \newcolumntype{C}{>{\Centering\arraybackslash}X}
    \usepackage{multirow} 
\begin{document}
\begin{table}
\caption{Parameters}
\begin{tabularx}{\textwidth}{@{}ccccCC@{}}
\hline
Altitude & $\alpha$  &  $\bar{H}$ &  
$\bar{o} $ & velocity $\lambda$ with streaming &  velocity 
$\lambda$ without streaming\\
\hline 
 400 km  & 7  & 6  & 1  & 2 & 1\\
 500 km  & 5  & 6  & 5  & 3 & 1 \\
 600 km  & 29 & 8  & 55 & 4 & 2 \\
 700 km  & 6  & 10 & 6  & 4 & 2\\
 800 km  & 4  & 13 & 8  & 4 & 2\\
 900 km  & 2  & 14 & 4  & 4 & 2\\
 1000 km & 5  & 14 & 4  & 5 & 2\\
 \hline
\end{tabularx}
\label{table:1}
 \end{table}
  \end{document}

This how it looks like...

4
  • Do you want your table to be as wide as the textwidth or do you want line breaks in teh column headers to avoid overly wide columns? – leandriis Oct 10 '20 at 18:57
  • I want it to be as wide as the text width except for the last two columns I want the text in headers to be wrapped. – Alaa Fayad Oct 10 '20 at 19:05
  • 1
    @AlaaFayad Please note that revtex4 is obsolete and should not be used for new documents. Instead, use revtex4-2. – Phelype Oleinik Oct 10 '20 at 21:52
  • I changed it to revtex4-2 and it works well ... Thank you a lot. – Alaa Fayad Oct 10 '20 at 22:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.