我真的希望两个点从左侧开始对齐。下面是我尝试的方法,我使用的包
\usepackage{booktabs}
\usepackage{tabularx} %% tables
\usepackage{ltablex}
\newcommand{\tabitem}{~~\llap{\textbullet}~~} %%% bullet in table
表代码
\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}
有什么建议吗?提前致谢。
答案1
我更喜欢使用带有 功能的环境,而不是大致模拟 itemize 环境enumitem
。我使用以下命令添加了一些填充\setcellgapes
:
\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}