1

I need to create this table

enter image description here

This is what I have done so far

\begin{table}[h!]
  \begin{center}
    \begin{tabular}{|l|c|r|} % <-- Alignments: 1st column left, 2nd middle and 3rd right, with vertical lines in between
    \hline
      \textbf{Category} & \textbf{Tool}\\ \hline
      $ $ & Command & Description \\
      \hline
      Editor & emacs & Emacs extensible text editor\\
       & vi & Visual editor\\\hline
      Scripting & bash & GNU Bourne-Again SHell\\
       & perl & Practical Extraction and Report Language\\\hline
       Document & rcs & Revision Control System\\
       Management & \LaTeX & Document Typesetting Package\\
        & make & Managing Project Utility\\\hline
    \end{tabular}
     \caption{Some Unix Utilities}
    \label{tab:table1}
  \end{center}
\end{table}

But I am unsure on how to position the text correctly in the table and how to make it so the lines in the first row is how it is suppose to be in the picture.

2

There you go

\documentclass{article}
\usepackage{array}
\begin{document}
\begin{table}[h!]
  \centering
    \begin{tabular}{|l|>{\ttfamily}r|l|} % <-- Alignments: 1st column left, 2nd middle and 3rd right, with vertical lines in between
    % No, your alignments are wrong :)
    \hline
      Category & \multicolumn{2}{c|}{Tool}\\ \cline{2-3}
      & \normalfont Command & Description \\
      \hline
      Editor & emacs & Emacs extensible text editor\\
       & vi & Visual editor\\\hline
      Scripting & bash & GNU Bourne-Again SHell\\
       & perl & Practical Extraction and Report Language\\\hline
       Document & rcs & Revision Control System\\
       Management & \LaTeX & Document Typesetting Package\\
        & make & Managing Project Utility\\\hline
    \end{tabular}
     \caption{Some Unix Utilities}
    \label{tab:table1}
\end{table}
\end{document}

enter image description here

However, I think you should use booktabs package to have a better-looking table. For example:

\documentclass{article}
\usepackage{array}
\usepackage{booktabs}
\begin{document}
\begin{table}[h!]
  \centering
    \begin{tabular}{@{}l@{}>{\ttfamily}rl@{}} 
    \toprule
      Category & \multicolumn{2}{c}{Tool}\\ \cmidrule{2-3}
      & \normalfont Command & Description \\
      \midrule
      Editor & emacs & Emacs extensible text editor\\
       & vi & Visual editor\\
      \midrule
      Scripting & bash & GNU Bourne-Again SHell\\
       & perl & Practical Extraction and Report Language\\
      \midrule
       Document & rcs & Revision Control System\\
       Management & \LaTeX & Document Typesetting Package\\
        & make & Managing Project Utility\\
      \bottomrule
    \end{tabular}
     \caption{Some Unix Utilities}
    \label{tab:table1}
\end{table}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.