I have the following long table with tabularx.
\renewcommand\tabularxcolumn[1]{m{#1}}
\begin{tabularx}{\textwidth}{|>{\hsize=.25\hsize\centering\let\newline\\\arraybackslash}X|
>{\hsize=.5\hsize\raggedright\let\newline\\\arraybackslash}X|
>{\hsize=.25\hsize\centering\let\newline\\\arraybackslash}X|}
\hline
\thead{Thời gian}
& \thead{Công việc}
& \thead{Người thực hiện}
\\
\hline
x/x/xx
\newline
-
\newline
x/x/xx
&
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.
\newline
- Lorem Ipsum is simply dummy text of the printing and typesetting industry.
&
Lorem Ipsum is simply dummy
\\
\hline
\thead
worked pretty well. I used \thead
because I want texts in the header row centered and the content of the middle column to float left or \raggedright
.
The problem comes here when I breaking line \\
to a random \thead
like this:
\renewcommand\tabularxcolumn[1]{m{#1}}
\begin{tabularx}{\textwidth}{|>{\hsize=.25\hsize\centering\let\newline\\\arraybackslash}X|
>{\hsize=.5\hsize\raggedright\let\newline\\\arraybackslash}X|
>{\hsize=.25\hsize\centering\let\newline\\\arraybackslash}X|}
\hline
\thead{Thời gian}
& \thead{Công việc}
& \thead{Người \\ thực hiện}
\\
\hline
x/x/xx
\newline
-
\newline
x/x/xx
&
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.
\newline
- Lorem Ipsum is simply dummy text of the printing and typesetting industry.
&
Lorem Ipsum is simply dummy
\\
\hline
The FIRST and SECOND \thead
column have changed their anchor and do not center veticaly anymore.
Can you show me how to fix this?
m
columns using\tabularxcolumn
you have not shown how you have defined\thead
nor provided a test documentm
columns using\tabularxcolumn
? And I have used the usual\thead
, so I do not define any on it yet.\thead
tabularx defines no command of that name.\renewcommand\tabularxcolumn#1{m{#1}}
would make tabularx use m columns\renewcommand\tabularxcolumn[1]{m{#1}}