如何调整表格内的文字

如何调整表格内的文字

我正在创建一个表格,其中包含可用逗号分隔的长文本;我已将第二列的文本宽度定义为 11 厘米。现在,我想以对齐形式显示文本,但结果并不如预期。我也使用了 tabulary 包,但没有帮助。

我怎样才能对齐文本?


\begin{table*}
  \centering
   \caption{Website which spreads Fake News}
  \begin{tabular}{ p{1.4 cm} p{11 cm}} 
\toprule

\textbf{Language} & \textbf{Domain of Websites}   \\ \hline


English & \href{www.rt.com}{rt.com},\href{www.dailyallegiant.com}{dailyallegiant.com},\href{www.naturalnews.com}{naturalnews.com}, \href{www.thegatewaypundit.com{thegatewaypundit.com},\href{www.rt.com{rt.com},\href{www.dailyallegiant.com{dailyallegiant.com},\href{www.naturalnews.com}{naturalnews.com}, \href{www.thegatewaypundit.com}{thegatewaypundit.com},\href{www.rt.com{rt.com},\href{www.thegatewaypundit.com{thegatewaypundit.com},\href{www.rt.com{rt.com},\href{www.thegatewaypundit.com}{thegatewaypundit.com},\href{www.rt.com}{rt.com}

\hline
  \end{tabular}
  \label{tab:example}
\end{table*}

答案1

我不知道你想要什么,因为使用你的代码(经过一些小改进)我得到了这样的结果:

表格预览

正如大卫·卡莱尔所说,问题在于只有在某些地方才有空间。

我使用的代码是这样的:

\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\usepackage{tabulary}
\usepackage{hyperref}

\title{stack tex table}
\author{Table}
\date{\today}

\begin{document}

\maketitle

\begin{table*}[ht]
  \centering
  \caption{Website which spreads Fake News}
  \begin{tabular}{ p{1.4 cm} p{11 cm}} 

\textbf{Language} & \textbf{Domain of Websites}   \\ \hline


English & \href{www.rt.com}{rt.com}, \href{www.dailyallegiant.com}{dailyallegiant.com}, \href{www.naturalnews.com}{naturalnews.com}, \href{www.thegatewaypundit.com}{thegatewaypundit.com}, \href{www.rt.com}{rt.com}, \href{www.dailyallegiant.com} {dailyallegiant.com}, \href{www.naturalnews.com}{naturalnews.com},  \href{www.thegatewaypundit.com}{thegatewaypundit.com}, \href{www.rt.com}{rt.com}, \href{www.thegatewaypundit.com}{thegatewaypundit.com}, \href{www.rt.com}{rt.com}, \href{www.thegatewaypundit.com}{thegatewaypundit.com}, \href{www.rt.com}{rt.com} \\
\hline
  \end{tabular}
  \label{tab:example}
\end{table*}

\end{document}

相关内容