Created
May 19, 2018 20:40
-
-
Save jimratliff/b3609894841704c2bfac22a40b1593ee to your computer and use it in GitHub Desktop.
Insert 4-column table with centered columns. #latex #snippet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\begin{table} [!htb] % p option positions table on its own page. | |
\centering | |
\caption{Generic 4-column table with centered columns} | |
%\label{table:NAME} | |
% Uncomment the below \rowcolors line to produce alternating shading of rows | |
%\rowcolors{2}{tableShade}{white} % start alternating shades from 2nd row (not counting header) | |
% K is my custom-specified column type, which is assumed to have been defined in the preamble as: | |
% \newcolumntype{K}[1]{>{\centering\arraybackslash}m{#1}} | |
% A "K" column is both centered horizontally and of the specified width | |
% To change to paragraph (full justification), change "K" to "m", which retains middle vertical alignment. | |
\begin{tabular}[t]{K{3.375cm}K{3.375cm}K{3.375cm}K{3.375cm}} | |
\toprule | |
1ColHeader & 2ColHeader & 3ColHeader & 4ColHeader \\ | |
\midrule | |
R1C1 & R1C2 & R1C3 & R1C4 \\ | |
R2C1 & R2C2 & R2C3 & R2C4 \\ | |
R3C1 & R3C2 & R3C3 & R3C4 \\ | |
\bottomrule | |
\end{tabular} | |
\end{table} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment