![表格单元格中从左侧开始的多行](https://linux22.com/image/355581/%E8%A1%A8%E6%A0%BC%E5%8D%95%E5%85%83%E6%A0%BC%E4%B8%AD%E4%BB%8E%E5%B7%A6%E4%BE%A7%E5%BC%80%E5%A7%8B%E7%9A%84%E5%A4%9A%E8%A1%8C.png)
我真的希望两个点从左侧开始对齐。下面是我尝试的方法,我使用的包
\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}