How can I generate this table in Latex? I have tried various codes but did not. I would appreciate any help.
[Tex/LaTex] Generate table with latex
tables
Related Solutions
You can just add \centering
right after \begin{table}
to center the table:
\begin{table}
\centering
\begin{tabular}
...
\end{tabular}
\end{table}
As commented by @PeterGrill, if you are not using floats (i.e., \begin{table}
, \end{table}
), then you will need to group it:
{
\centering
\begin{tabular}
...
\end{tabular}
}
(note the extra {}
).
Here's an improvement to your code. It still requires the X
column type for the last column and makecell
. I replaced slashbox
with diagbox
:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{ragged2e}
\usepackage[table, svgnames]{xcolor}
\usepackage{array, tabularx, multirow, booktabs, diagbox}
\usepackage{makecell}
\setcellgapes{2pt}
\begin{document}
\noindent\setlength\extrarowheight{2pt}\begin{tabularx}{\linewidth}{|c|c| >{\arraybackslash}X|} \hline
\diagbox[width = 3.5cm, height =1.2cm]{Param. list}{\raisebox{-2ex}{Name}}
& Parameter & \multicolumn{1}{c|}{Description} \\\hline
\hline
\multirow{3}*{Replicate Type} & Biological & Rain most of the day\\
\cline{2-3}
& Technical & Sunny with some clouds xxxx\\
\cline{2-3}
\hline
\multirow{5}*{Thresholds} & $T^{s}$ (Stringent) & Rain most of the day\\
\cline{2-3}
& $T^{w}$ (Weak)& Sunny with some clouds xxxx\\
\cline{2-3}
& $\gamma$ & A clear day with a lot of sunshine\\
\hline
\multirowcell{2}{Multiple Testing \\correction} & FDR & Some long text. Some long text. \\\hline
\multirowcell{3}{Multiple Overlap\\ ERs treatment} & Use most stringent peak & Rain most of the day\\
\cline{2-3}
& Use least stringent peak & Sunny with some clouds. some long text\\
\cline{2-3}
\hline
\end{tabularx}
\end{document}
Best Answer
tabularx
so that the columns “south” and “north” would have the same length. We will define a new column type, Y, so that the content would be centered.SIunitx
to use units like gigawatt or percentmultirow
for the forth rowtabularx
in atable
environment and usecaption
after the tableHere we go: