Sorry for this question but I'm new using LaTeX. I have a table which width is set to be \textwidth
using tabularx{\textwidth}
and one of its rows will have 3 or 4 lines. This is my current code:
\renewcommand{\arraystretch}{1.2}
\arrayrulecolor{gray}
\begin{table}[b!] % hbtp
\centering
\begin{tabularx}{\textwidth}{ c | c | X }
\arrayrulecolor{black}
\hline
\textbf{$e_\#$} & \textbf{Time interval} & \textbf{Topic} \\
\hline
\arrayrulecolor{gray}
1 & \makecell{From: 2019-04-15 20:30:05 \\ To: 2019-04-15 21:30:05} & \textbf{díamundialdelarte, 15deabril:} enfocat(0.94), meningitis(0.94), construyendolarepública(0.94), 14deabril(0.68), ley(0.66), españa(0.62) \\
\hline
2 & \makecell{From: 2019-04-15 09:00:05 \\ To: 2019-04-15 17:00:05} & \textbf{gracias:} semana(0.61), muchísimas(0.64) \\
\hline
3 & \makecell{From: 2019-04-15 19:30:05 \\ To: 2019-04-16 01:00:05} & \textbf{notre:} dame(0.98), catedral(0.92), incendio(0.76), parís(0.91), historia(0.73), humanidad(0.77), llamas(0.74), paris(0.64), tristeza(0.65) \\
\hline
\end{tabularx}
\caption{April 15th 2019 top 3 events}
\label{tab:mabed-impact}
\end{table}
\arrayrulecolor{black}
\renewcommand{\arraystretch}{1.5}
and this is its visualization:
I would like that:
- All the cells were vertically centered
- Columns 1 and 2 were horizontally centered
- Column 3 were horizontally left aligned, but its header (row 1) were horizontally centered
How can achieve this?
UPDATE:
\begin{table}[hbtp]
\centering
\renewcommand{\tabularxcolumn}[1]{m{#1}}
\begin{tabularx}{\textwidth}{ c c >{\RaggedRight}X }
\toprule
\textbf{$e_\#$} & \textbf{Time interval} & \makecell[cc]{\textbf{Topic}} \\
\midrule
1 & \begin{tabular}[t]{r@{:~}l} From & 2019-04-15 20:30:05 \\ To & 2019-04-15 21:30:05\end{tabular} & \textbf{díamundialdelarte, 15deabril:} enfocat(0.94), meningitis(0.94), construyendolarepública(0.94), 14deabril(0.68), ley(0.66), españa(0.62) \\\addlinespace
2 & \begin{tabular}[t]{r@{:~}l}From& 2019-04-15 09:00:05 \\ To & 2019-04-15 17:00:05\end{tabular} & \textbf{gracias:} semana(0.61), muchísimas(0.64) \\ \addlinespace
3 & \begin{tabular}[t]{r@{:~}l}From & 2019-04-15 19:30:05 \\ To & 2019-04-16 01:00:05 \end{tabular} & \textbf{notre:} dame(0.98), catedral(0.92), incendio(0.76), parís(0.91), historia(0.73), humanidad(0.77), llamas(0.74), paris(0.64), tristeza(0.65) \\
\bottomrule
\end{tabularx}
\caption{April 15th 2019 top 3 events}
\label{tab:mabed-impact}
\end{table}