如何在longtabu中使用justify对齐而不影响表格?

如何在longtabu中使用justify对齐而不影响表格?

我正在使用以下代码来生成表格。

    \begin{longtabu} to \linewidth{@{}XX[6]X[2,c]X[1.5,c]@{}} %{X[1,c]X[4,l]X[1,c]X[l,c]}

\rowcolor{brown!50!black} & \multicolumn{3}{c}{   \color{white} Completed projects (Inter-institutional collaborative projects)}\\
\rowcolor{brown!50!black}    \color{white}  Funding Agency&     \color{white}Title of Project &         \color{white}   Amount\newline (in \rupee)   &      \color{white} Year of sanctioned\newline(Duration)            \\                           
 DST
 &  Genomic variation analysis and gene expression profiling of human dosha prakriti based on principals of ayurveda.                                                &     8,64,000 &March 2007\newline  3 Years
            \\
Intel corporate technology group & Mobile monitoring solutions to improve health outcomes in non-communicable diseases – systematic review. &  2,35,000 &2007\newline  3 Years\\
 ICMR &Aetiology of Acute Encephalitis Syndrome (AES) in India and Establishment of ICMR sample banks of AES cases” – a multisite prospective initiative &  1,04,76,449
 & March 2011\newline 3 Years \\
ICMR &  Molecular epidemiology of rotavirus diarrhea in children under five in Southwest India- A hospital and laboratory based study &  38,75,688 & March 2012\newline 3 Years\\

\end{longtabu}

输出如下。

在此处输入图片描述

为什么角落没有被完全覆盖?

有了代码 \begin{longtabu} to \linewidth {X[1,c]X[4,l]X[1,c]X[l,c]}我就没遇到这个问题。

将此命令替换为后,我遇到了这个问题 \begin{longtabu} to \linewidth{@{}XX[6]X[2,c]X[1.5,c]@{}} %{X[1,c]X[4,l]X[1,c]X[l,c]}

调整表中列的对齐方式。

如何摆脱这种情况?有没有办法在不遇到此类问题的情况下证明单元格合理性?

答案1

像这样?

在此处输入图片描述

\multicolumn为此,您需要对第一行进行一些细微的更改:

   \begin{longtabu} to \linewidth{@{}XX[6]X[2,c]X[1.5,c]@{}} %{X[1,c]X[4,l]X[1,c]X[l,c]}
\rowcolor{brown!50!black} 
    & \multicolumn{3}{c@{}% <-- added 
                          }{\color{white} Completed projects (Inter-institutional collaborative projects)}\\
\rowcolor{brown!50!black}    
\color{white}  Funding Agency
    & \color{white}Title of Project &  \color{white}  Amount\newline (in  \rupee)   &  \color{white} Year of sanctioned\newline(Duration)            \\

我喜欢展示完整的 MWE,但是你没有提供足够的信息(我在编译时收到错误)。如果你能添加序言和使用的包和\newcommands,我会完成我的代码。

相关内容