1

I need to make a similar table: enter image description here

I get something like that

\documentclass[]{article}
\usepackage{tabularx, colortbl, booktabs}
\usepackage[table]{xcolor} 

\begin{document}
\rowcolors{1}{cyan!30}{white}
        \begin{table}[htbp!]    
            \begin{tabularx}{1\textwidth}{l*5{>{\centering\arraybackslash}X}}
                \toprule
                \rowcolor{cyan!60}
                $l$ &  0  &  1  &  2  &  3  &  4  \\ \midrule
                letter   & $s$ & $p$ & $d$ & $f$ & $g$ \\ 
                letter   & $s$ & $p$ & $d$ & $f$ & $g$ \\
                letter   & $s$ & $p$ & $d$ & $f$ & $g$ \\
                letter   & $s$ & $p$ & $d$ & $f$ & $g$ \\
                letter   & $s$ & $p$ & $d$ & $f$ & $g$ \\
                \bottomrule
            \end{tabularx}
        \end{table}

\end{document}

Is any simple way to control (color, thicknes, distances, ...) on booktabs elements?

  • @CarLaTeX Sorry, I added MWE – sergiokapone Mar 8 '17 at 17:00
2
\documentclass[]{article}
\usepackage[table]{xcolor} 
\usepackage{booktabs, cellspace, colortbl, tabularx}

\begin{document}
\begin{table}[htbp!]
\setlength\cellspacetoplimit{4pt}
\setlength\cellspacebottomlimit{4pt}
\setlength\aboverulesep{0pt}
\setlength\belowrulesep{0pt}
\arrayrulecolor{blue}% select color according to your wish/taste
\rowcolors{2}{cyan!20}{white}    
    \begin{tabularx}{1\textwidth}{l*5{>{\centering\arraybackslash}X}}
        \toprule[4pt]% <-- option for rule thicknes
        \rowcolor{cyan!40}
        $l$ &  0  &  1  &  2  &  3  &  4  \\ \midrule
        letter   & $s$ & $p$ & $d$ & $f$ & $g$ \\
        letter   & $s$ & $p$ & $d$ & $f$ & $g$ \\
        letter   & $s$ & $p$ & $d$ & $f$ & $g$ \\
        letter   & $s$ & $p$ & $d$ & $f$ & $g$ \\
        letter   & $s$ & $p$ & $d$ & $f$ & $g$ \\
        \bottomrule
    \end{tabularx}
\end{table}
\end{document}

enter image description here

  • How about rule colors and thickness? – sergiokapone Mar 8 '17 at 17:11
  • @sergiokapone, momentary I'm faced with uploading problems, consequently my answer is not complete. I will complete asap. – Zarko Mar 8 '17 at 17:20
  • @sergiokapone, now I finally siucceed to upload recent version of code, and add image of table. – Zarko Mar 8 '17 at 17:30
  • @Zarko: Needless to load colortbl if you load xcolor with option [table] (I love minimalistic codes ;o)) – Bernard Mar 8 '17 at 19:23
  • @Bernard, I overlooked, that OP have loaded it. Of course, it is surplus to load it again (it is loaded by xcolor already). I delete it. Thank you. – Zarko Mar 8 '17 at 20:33

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.