我需要帮助在 LaTeX 中放置表格

我需要帮助在 LaTeX 中放置表格

我是 LaTeX 新手,为了完成我的论文,我需要创建一些大型表格。我能够在 LaTeX 中创建简单的表格,但是,我遇到了一些困难,特别是这个:

在此处输入图片描述

如何使第 2 列和第 3 列对齐?在第 2 列中,我希望每个上下文因素与第 3 列中的定义完全对齐。

梅威瑟:

\begin{table}[ht]
\begin{tabular}{ |m{3cm} | m{4.5cm} | m{5cm}| m{4cm} | }
\hline
\textbf {Authors } & \textbf{Contextual factors} & \textbf{Definition} & \textbf{Findings} \\ \hline
\cite{Pavlou2007} & \multirow{3}{*} Trust\\
&Website informativeness\\
&Social presence\\
& blabla \hline \hline
\end{tabular}
\caption{Literature review on contextual factors of privacy concerns} \label{table:7}
\end{table}

答案1

我不确定这是否是您想要的,但我很快尝试模仿您的表格。我使用命令\small将字体缩小一点,并使用命令\renewcommand{\arraystretch}{1.5}将行之间的垂直间距拉长以更符合您的表格,但您当然可以更改这一点。{1.5}如果您想要更多或更少的间距,请将更改为更高或更低的数字。

我使用p{#cm}而不是m{#cm}来定义列宽。这将自动在需要的地方填充文本,并且不会超出您指定的边界。

至于实际的表格,您只需使用行和线即可完成此操作。您的第一行(不包括列名)将包含“Pavlou”、“Trust”、“此处有很多文本”和“Trust,...”。只需通过添加结束此行\\并开始下一行即可。

将第一列留空,然后在其他列中输入内容。它们应该全部正确对齐,因为它们位于同一行。保持简单!只需使用空单元格(输入&而不提供值)仍会使它们对齐,就像有内容的单元格一样。

我希望这有帮助。

\documentclass{article}
\begin{document}
\begin{table}[h]
\small
\renewcommand{\arraystretch}{1.5}
\begin{tabular}{|p{2cm}|p{3cm}|p{4cm}|p{4cm}|}
\hline
Authors & Contextual factors & Definition & Findings\\ \hline
Pavlou et al. (2007) & Trust & A buyer's intentions to accept vulnerability based on her beliefs that transactions with a seller will meet her... & Trust, web site\\
& Website informativeness & The degree to which a website offers information that buyers perceive as useful,... & \\
& Social Pressure & The extent to which a medium is perceived as truly conveying... & \\ \hline
\end{tabular}
\end{table}
\end{document}

尝试到你的桌子

答案2

这是我尝试复制您的部分输出;)

输出

在此处输入图片描述

代码

\documentclass[10pt]{article}
\usepackage[style=authoryear]{biblatex}
%\usepackage{booktabs}
%\usepackage{lipsum}
\usepackage{xcolor, soul}
\setulcolor{red}

\addbibresource{bibliography.bib}
\begin{document}
\begin{table}
\small
\caption{Some odd looking red lines, along with some information.}
\renewcommand{\arraystretch}{1.4}
\begin{tabular}{|l|l|p{4cm}|p{4cm}|}
    \hline
    Authors             & Centextiual factors   & Definition\footnotemark & Findings\\
    \hline
    \cite{testA}        & Trust & ``A buyer´s intentions to accept vulnerability based on her beliefs that transactions with a seller will meet her confident transaction expectations due to the seller's competence, integrity, and benevolence'' & Trust, web site \ul{informativeness} and social presence all decrease information concerns.\\
                    &Website \ul{informativeness}&  ``The degree to which a website offers information that buyers percieve as useful, such as privacy or security practices'' & \\
                    &Social presence    & The extent to which a medium is precieved as truly conveying the presence of the communicating participants''&\\
    \hline
    \cite{testB}        & Internet literacy & ``The ability to use a network-connected computer and internet applications to accomplish practical tasks'' & Internet literacy negatively affects privacy concerns.
    \end{tabular}
\end{table}
\end{document}

答案3

我建议你在 lyx 中实现表格,然后在你拥有的任何 Latex 编辑器中编辑其 latex 源。这样,你可以实现非常复杂的表格,而无需在实现时考虑细节。

相关内容