9

I want to add a table in the following format: enter image description here

But don't know what's wrong with my script that doesn't work.

\documentclass[9pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{fontspec}
\usepackage[british]{babel}
\setlength{\columnsep}{25 pt} % Distance between two columns
\usepackage{tabularx,ragged2e,booktabs,caption}
\usepackage{subfigure}
\usepackage{multicol,tabularx,capt-of}
\usepackage{hhline}
\usepackage{multirow}

\begin{document}
\begin{table}
\centering
\renewcommand{\arraystretch}{1.2}
\begin{tabular}{|c|c|c|c|c|}
 \hline
  \multirow{2}{*}{\textbf{Mode Transition Times Duration (Typical)}} &\multicolumn{3}{c|}{\textbf{CLK Frequency}} & \textbf{Unit}\\
 \hline
 \textbf{Inactive Modes} & \textbf{Description}\\
\hline
 \textbf{12 or 24} & \textbf{13 or 26} & \textbf{16 or 32} & \textbf{[MHz]}\\
  \hhline{~--}
First condition & 1365 & 1260 & 1024 & \mu s \\ \hline
Second condition & TBD & TBD & TBD & \mu s \\ \hline
Third condition & TBD & TBD & TBD & \mu s  \\ \hline
Fourth condition & TBD & TBD & TBD & \mu s  \\ \hline
\end{tabular}
\caption{Mode Transition Times}
\end{table}

\end{document}
1
  • 1
    A compilable example would be greatly appreciated. Starting from \documentclass and ending with \end{document}.
    – Manuel
    Commented Jul 9, 2014 at 11:03

1 Answer 1

12

You are missing $ around \mu (which must be in math mode). your \hhline was on a diferent row as it should be. And you were missing a & (column) in the second row.

I used scrartcl since it lets you use [9pt], which doesn't work with article.

\documentclass[9pt]{scrartcl}
\usepackage[british]{babel}
\usepackage{hhline}
\usepackage{multirow}

\begin{document}

\begin{table}
  \centering
  \renewcommand{\arraystretch}{1.2}
  \begin{tabular}{|p{5cm}|c|c|c|c|}
    \hline
    \multirow{2}{5cm}{\textbf{Mode Transition Times Duration (Typical)}} & \multicolumn{3}{c|}{\textbf{CLK Frequency}} & \textbf{Unit}\\
    % \hline
    % \textbf{Inactive Modes} & \textbf{Description}\\
    \cline{2-5}
    & \textbf{12 or 24} & \textbf{13 or 26} & \textbf{16 or 32} & \textbf{[MHz]}\\
    %\hhline{~--}
    \hline
    First condition & 1365 & 1260 & 1024 & $\mu$ s \\ \hline
    Second condition & TBD & TBD & TBD & $\mu$ s \\ \hline
    Third condition & TBD & TBD & TBD & $\mu$ s  \\ \hline
    Fourth condition & TBD & TBD & TBD & $\mu$ s  \\ \hline
  \end{tabular}
  \caption{Mode Transition Times}
\end{table}

\end{document}

enter image description here

You must log in to answer this question.

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