0

I tend to forget Latex again.

How to make the content to start from left, while the first row remains middle?

enter image description here

Myt MWE:

  \documentclass{article}
\usepackage{cases}
\usepackage{tabularx}
\usepackage{tikz}
\usepackage{subcaption}
\usepackage{table}

\begin{document}

\begin{center}
    \begin{longtable}{|c|C{8cm}|C{8cm}|}
        \hline 
        \bf{No.} & \bf{Revision} & \bf{Action Taken} \tabularnewline
        \hline
        1. & Testing Testing Testing & Action Taken Action Taken \tabularnewline
        \hline
        2. & Testing Testing Testing & Action Taken Action Taken  \tabularnewline
        \hline
    \end{longtable}
\end{center}


\end{document}
2
  • 3
    How or where is the C column type defined? Have you considered changing both instances of C to p?
    – Mico
    Dec 16, 2020 at 0:32
  • 3
    Incidentally, you should not encase a longtable environment in a center environment. And please replace all instances of \bf with \textbf.
    – Mico
    Dec 16, 2020 at 0:36

1 Answer 1

3

enter image description here

\documentclass{article}
\usepackage{ragged2e}
\usepackage{longtable, makecell, tabularx}
\renewcommand\theadfont{\normalsize\bfseries}
\renewcommand\theadgape{}


\begin{document}

\renewcommand\arraystretch{1.2}
    \begin{longtable}{|c|*{2}{>{\RaggedRight\hspace{0pt}}p{5cm}|}}% with 8cm columns table will  not fit on page
        \hline
        \thead{No.} & \thead{Revision} & \thead{Action Taken}   \tabularnewline
        \hline
        1. & Testing Testing Testing & Action Taken Action Taken \tabularnewline
        \hline
        2. & Testing Testing Testing & Action Taken Action Taken  \tabularnewline
        \hline
    \end{longtable}

\end{document}
3
  • thanks. However, the table is located at the centre. and not the left
    – aan
    Dec 16, 2020 at 1:39
  • 3
    @aan, table is horizontally centered, also column headers are horizontal centered in cells as you show in image in question, content in other rows are left aligned. If you like to have different alignment of text in tables, then please clarify this in your question.
    – Zarko
    Dec 16, 2020 at 1:46
  • 2
    @aan - longtable environments are automatically centered horizontally.
    – Mico
    Dec 16, 2020 at 2:24

You must log in to answer this question.

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