1

First of all I want to point out that I'm newbie at LaTeX, but I have searched forums on the quest to answer my question, but to no good.

Basically I want to justify one table column to the right, but I just can't.

The code I am using is the following:

\begin{table}[]
\caption{Measured features.}
\label{table:measured_features}
\renewcommand{\arraystretch}{1.35}
\begin{tabular}{r l} 
\hline\hline
\multicolumn{1}{p{5cm}}{\textbf{Feature}}
& \multicolumn{1}{p{8.5cm}}{\textbf{Description}}\\
\hline
\multicolumn{2}{l}{\textbf{Time features}}                                                                                                     \\ \hline

\multicolumn{1}{p{5cm}}{P\textsubscript{dur}/P\textsubscript{dur,RRnorm}}
& \multicolumn{1}{p{8.5cm}}{Pwave duration (either normalised with the current RR interval or not)} \\

\multicolumn{1}{p{5cm}}{P\textsubscript{init. dur}/P\textsubscript{fin. dur}}
& \multicolumn{1}{p{8.5cm}}{P-wave initial/final duration: from onset to peak/from peak to offset, respectively} \\

\multicolumn{1}{p{5cm}}{PQ\textsubscript{on}/ PQ\textsubscript{off}/ PQ\textsubscript{on.RRnorm}/ PQ\textsubscript{off.RRnorm}}
& \multicolumn{1}{p{8.5cm}}{ PQ interval since P-wave onset/offset. respectively (either normalised with current RR or not)} \\ 
\end{tabular}
\end{table}

Furthermore, I have added the following code to my preamble:

\usepackage{booktabs}    % Beautiful simple tables
\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
 \usepackage{multirow}

How can I justify the left column to the right side?

Many thanks! Diogo

1 Answer 1

1

Is this what you want? I simplified your code, loaded the caption package to have a decent spacing between caption and table, and used the nicer rules from booktabs. I don't know what you want to do with the column type definitions.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{booktabs} % Beautiful simple tables
\usepackage{array}
\usepackage{ragged2e}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
 \usepackage{multirow, caption}

\begin{document}

\begin{table}[!htb]
\caption{Measured features.}
\label{table:measured_features}
\renewcommand{\arraystretch}{1.35}
\begin{tabular}{ >{\RaggedLeft}p{5cm} p{8.5cm}}
\toprule\midrule
 \multicolumn{1}{l}{\textbf{Feature}}
& \multicolumn{1}{p{8.5cm}}{\textbf{Description}}\\
\midrule
\multicolumn{2}{l}{\textbf{Time features}} \\
\midrule
P\textsubscript{dur}/P\textsubscript{dur,RRnorm}
& Pwave duration (either normalised with the current RR interval or not) \\
%
P\textsubscript{init. dur}/P\textsubscript{fin. dur}
& P-wave initial/final duration: from onset to peak/from peak to offset, respectively \\
%
PQ\textsubscript{on}/ PQ\textsubscript{off}/ PQ\textsubscript{on.RRnorm}/ PQ\textsubscript{off.RRnorm}
& PQ interval since P-wave onset/offset. respectively (either normalised with current RR or not)\\
\bottomrule
\end{tabular}
\end{table}

\end{document} 

enter image description here

0

You must log in to answer this question.

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