0

I am trying to make a table in latex have same outline as this table below. enter image description here

After some attempts, this is what I get at the moment. enter image description here

I really want the two dot points to align with each other, starting from the left hand side. Below is how I attempt it, package I used

\usepackage{booktabs}
\usepackage{tabularx} %% tables
\usepackage{ltablex} 
\newcommand{\tabitem}{~~\llap{\textbullet}~~} %%% bullet in table

Table code

 \begin{center}
 \begin{table}[H]

\resizebox{\textwidth}{!}
{\begin{tabular}{|c |c |c |c |}  \hline
\textit{\textbf{Governing Equations}} & \textit{\textbf{Basic Assumptions}} & \textit{\textbf{Advantages}} & \textit{\textbf{Disadvantages }}\\ 
 \hline
 \textbf{Navier-Stokes} &  \makecell{ \tabitem Incompressible Newtonian fluid \\ \tabitem  Only gravity is considered as body force } &  \tabitem Comprehensive &  \tabitem Computationally expensive \\
 \hline
& & & \\
 \hline

\end{tabular}}
 \caption[Simulation Costs]{Simulation costs based on actual walltime per simulation time per CPU and per control volume (CV). Approximates were applied, due to some inevitable factors, such as queueing time on Tinaroo.}
\label{tab:SimulationCosts}

   \end{table}
\end{center}

Any suggestions? Thanks in advance.

1

Instead of approximately emulating an itemize environment, I prefer to use one, with the facilities of enumitem. I added some padding with the \setcellgapescommand:

\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{ltablex,booktabs,ragged2e, enumitem, makecell, float, textcomp}
\renewcommand\tabularxcolumn[1]{>{\RaggedRight\arraybackslash}p{#1}}
\newcommand{\tabitem}{~~\llap{\textbullet}~~} %%% bullet in table

\begin{document}

 \begin{table}[H]
 \footnotesize\keepXColumns
 \renewcommand\theadfont{\bfseries\itshape}
 \setcellgapes{3pt}\makegapedcells
 \setlist[itemize]{wide =0pt, leftmargin=*, nosep, before=\vspace{-\baselineskip}, after = \vspace{-\baselineskip}}
\begin{tabularx}{\linewidth}{|c |X |c |c |} \hline
\thead{Governing Equations} & \thead{Basic Assumptions} & \thead{Advantages} & \thead{Disadvantages}\\
 \hline
 \textbf{Navier-Stokes} & \mbox{}\begin{itemize} \item Incompressible Newtonian fluid
 \item Only gravity is considered as body force\end{itemize} & \tabitem Comprehensive & \tabitem Computationally expensive \\
 \hline
& & & \\
 \hline
\end{tabularx}%
\end{table}

\end{document} 

enter image description here

  • Hi Bernard Thanks for answering, but when I combined this table, there are some funny lines all around the place, not sure why. BTW, how to insert images in the comment, I tired ctrl+G, no working – Zhifang Hu May 26 '17 at 0:18
  • It's only the showframe option of geometry, to check nothing overflows. Simply remove the option. – Bernard May 26 '17 at 0:23
  • @ZhifangHu You can't insert images in comments, but you can upload them to e.g. Imgur and post a link. – Torbjørn T. May 27 '17 at 8:19
  • @Bernard Hi Bernard, I know this question has been here for a while, but after I used tabularx, i find my table numbering is not right, whenever i use this tabularx, the table name will be a even number, say for example, i have 2 tables should be named table 1, 2 respectively, but it turned out to be table 2 and 4, any suggestions how to fix it? thanks in advance. – Zhifang Hu Jun 15 '17 at 1:48
  • @ZhifangHu: This is due to loading ltablex, which is done to break tabularx tables across pages: the syntax has to be the same as for long table, which is not a float. You have to put the caption inside the firsthead section of the table, and remove the table environment, since the tabularx will not float. Alternatively, if you don't have long tabularx which you want to break across pages, don't load ltablex and use the standard way to code the caption. – Bernard Jun 15 '17 at 8:48

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.