我创建了一个有 5 列的表格,第 5 列包含这样的描述(每行都是一长段文本)。
\begin{table}[]
\begin{tabular}{ccccc}
\hline
column1 & column2 & column3 & column4 & column5 \\ \hline
knowlesi & -ve & +ve & +ve & A primate malaria parasite commonly found in Southeast Asia. \\
facto & -ve & +ve & +ve & Rare syndromic condition with (Fibular Aplasia, Tibial Campomelia and Oligosyndactyly with Talar Aplasia). \\
leucoencephalopathy & -ve & +ve & +ve & Brain disorder that predominantly affects the cerebral white matter. \\
fistula-in-ano & -ve & +ve & +ve & Chronic abnormal communication between the epithelialised surface of the anal canal and (usually) the perianal skin. \\
Desmoid & -ve & +ve & +ve & An abnormal growth that arises from connective tissue, which is the tissue that provides strength and flexibility to structures such as bones, ligaments, and muscles. \\
metapneumovirus & -ve & +ve & & Is a recently described respiratory virus. \\
Tracheobronchomalacia & -ve & +ve & & TBM is a condition characterized by flaccidity of the tracheal support cartilage which leads to tracheal collapse. This condition can also affect the bronchi. \\
RESLES & -ve & +ve & & Refer to reversible splenial lesion syndrome. \\
mal-absorption & -ve & +ve & & Refers to a number of disorders in which the small intestine can't absorb enough of certain nutrients and fluids. \\
acroparesthesias & -ve & +ve & & A condition of burning, tingling, or pricking sensations or numbness in the extremities present on awaking and of unknown cause or produced by compression of nerves during sleep. \\
limb-shaking & -ve & +ve & & A rare presentation of transient ischemic attacks. \\
pineocytomas & -ve & +ve & & A tumor of the pineal gland, a small organ in the brain that makes melatonin (a sleep-regulating hormone). \\
hypomineralisation & -ve & +ve & & A type of enamel defect affecting, as the name suggests, the first molars and incisors in the permanent dentition. \\
neurognathostomiasis & -ve & +ve & & A neglected parasitosis of the central nervous system. \\
Metastasis & -ve & +ve & & A metastatic cancer, or metastatic tumor, is one which has spread from the primary site of origin (where it started) into different area(s) of the body. \\
myelomatosis & -ve & +ve & & Also called Kahler disease, A type of cancer that begins in plasma cells (white blood cells that produce antibodies). \\
AMRF & -ve & +ve & & Action myoclonus-renal failure syndrome which is a distinctive form of progressive myoclonus epilepsy associated with renal dysfunction. \\
arthralgia & -ve & +ve & & Pain in a joint. \\
leukopenia & -ve & +ve & & One of the white blood cell disorders. \\
fibrodentinoma & -ve & +ve & & Ameloblastic fibrodentinoma (AFD) is a debatable neoplasm with respect to its clinical, biological and histopathological diagnosis. \\
infantile-ataxia & -ve & +ve & & Infantile-onset spinocerebellar ataxia (IOSCA), is a severe, progressive neurodegenerative disorder characterized by normal development until age one year, followed by onset of ataxia, muscle hypotonia, loss of deep-tendon reflexes, and athetosis. \\ \hline
\end{tabular}
\end{table}
但它看起来是这样的:
我该如何修复它,以便第五列的内容换行而不是一行长
请问有什么帮助吗?
答案1
首先,欢迎来到 tex.se。其次,下次请考虑编写一个最小工作示例 (MWE) 代码,展示您的文档设置,以便这里的人们可以重新运行并重现您的问题。话虽如此,从您问题中可用的信息来看,似乎tabularx
适合您的需求。此外,使用包中的\toprule
、\midrule
和可以使输出更美观、更易读。\bottomrule
booktabs
此外,如果您不使用 tabularx ( \begin{table} .. \end{table}
) 周围的浮动环境,则应\noindent\begin{tabularx} ..
按照 @Bernard 在评论中的建议添加。对于 Beamer(我怀疑您在这里使用它),您不需要这样做。
\documentclass{article}
\usepackage{tabularx,booktabs}
\begin{document}
\begin{tabularx}{\linewidth}{cX}
\toprule
Manual analysis result & Another heading \\ \midrule
+ve & I want it to be as one long line as multiple lines, so the whole table appears. Any help, please? \\
+ve & I want it to be as one long line as multiple lines, so the whole table appears. Any help, please? \\
\dots & \dots \\
\dots & \dots \\ \bottomrule
\end{tabularx}
\end{document}
更新:
根据问题的最新信息,表格变得足够大,因此应该以横向模式排版。以下是使用该rotating
包的可能解决方案:
\documentclass{article}
\usepackage{tabularx,booktabs,rotating}
\begin{document}
\begin{sidewaystable}
\begin{tabularx}{\linewidth}{@{}lcccX@{}}
\toprule
column1 & column2 & column3 & column4 & column5 \\ \midrule
knowlesi & -ve & +ve & +ve & A primate malaria parasite commonly found in Southeast Asia. \\
facto & -ve & +ve & +ve & Rare syndromic condition with (Fibular Aplasia, Tibial Campomelia and Oligosyndactyly with Talar Aplasia). \\
leucoencephalopathy & -ve & +ve & +ve & Brain disorder that predominantly affects the cerebral white matter. \\
fistula-in-ano & -ve & +ve & +ve & Chronic abnormal communication between the epithelialised surface of the anal canal and (usually) the perianal skin. \\
Desmoid & -ve & +ve & +ve & An abnormal growth that arises from connective tissue, which is the tissue that provides strength and flexibility to structures such as bones, ligaments, and muscles. \\
metapneumovirus & -ve & +ve & & Is a recently described respiratory virus. \\
Tracheobronchomalacia & -ve & +ve & & TBM is a condition characterized by flaccidity of the tracheal support cartilage which leads to tracheal collapse. This condition can also affect the bronchi. \\
RESLES & -ve & +ve & & Refer to reversible splenial lesion syndrome. \\
mal-absorption & -ve & +ve & & Refers to a number of disorders in which the small intestine can't absorb enough of certain nutrients and fluids. \\
acroparesthesias & -ve & +ve & & A condition of burning, tingling, or pricking sensations or numbness in the extremities present on awaking and of unknown cause or produced by compression of nerves during sleep. \\
limb-shaking & -ve & +ve & & A rare presentation of transient ischemic attacks. \\
pineocytomas & -ve & +ve & & A tumor of the pineal gland, a small organ in the brain that makes melatonin (a sleep-regulating hormone). \\
hypomineralisation & -ve & +ve & & A type of enamel defect affecting, as the name suggests, the first molars and incisors in the permanent dentition. \\
neurognathostomiasis & -ve & +ve & & A neglected parasitosis of the central nervous system. \\
Metastasis & -ve & +ve & & A metastatic cancer, or metastatic tumor, is one which has spread from the primary site of origin (where it started) into different area(s) of the body. \\
myelomatosis & -ve & +ve & & Also called Kahler disease, A type of cancer that begins in plasma cells (white blood cells that produce antibodies). \\
AMRF & -ve & +ve & & Action myoclonus-renal failure syndrome which is a distinctive form of progressive myoclonus epilepsy associated with renal dysfunction. \\
arthralgia & -ve & +ve & & Pain in a joint. \\
leukopenia & -ve & +ve & & One of the white blood cell disorders. \\
fibrodentinoma & -ve & +ve & & Ameloblastic fibrodentinoma (AFD) is a debatable neoplasm with respect to its clinical, biological and histopathological diagnosis. \\
infantile-ataxia & -ve & +ve & & Infantile-onset spinocerebellar ataxia (IOSCA), is a severe, progressive neurodegenerative disorder characterized by normal development until age one year, followed by onset of ataxia, muscle hypotonia, loss of deep-tendon reflexes, and athetosis. \\ \bottomrule
\end{tabularx}
\end{sidewaystable}
\end{document}