如何在带有旋转文本的表格一侧放置边框线

如何在带有旋转文本的表格一侧放置边框线

我正在尝试添加此表右侧的边框/边界框线,它似乎删除了它,尽管在其他没有旋转文本以适应的表中不会发生这种情况。我想在“行业协会”后面有两行。我的理解是 ||

\begin{tabular}{||p{10cm}cccccccccc||}

应应用边界线。

有问题的桌子

代码:

\begin{landscape}
\renewcommand*\rot[2]{\multicolumn{1}{R{#1}{#2}}}% no optional argument here, please!

\begin{tabular}{||p{10cm}cccccccccc||}
\hline\hline
NEEDS \& EXPECTATIONS OF INTERESTED PARTIES &   \rot{90}{1em}{Employees \& Contractors} &   \rot{90}{1em}{Customers, Clients \& Suppliers} &    \rot{90}{1em}{Regulators} &     \rot{90}{1em}{Registrar} &  \rot{90}{1em}{Generators} &     \rot{90}{1em}{General Public, Media \& NGOs} &  \rot{90}{1em}{Neighboring Businesses} &     \rot{90}{1em}{Insurers} &   \rot{90}{1em}{Emergency Response Services} &    \rot{90}{1em}{Industry Associations} &  \\ [0.5ex]
\hline\hline                                            
1. Expect to work in a safe and healthy environment &   X &      &   &   &   &   &   &   &   &      \\
\hline\hline
\end{tabular}
\end{landscape}

(其中有更多文字,但出于保密原因我无法显示,表格格式保留。)

我也正在使用这些包:

\usepackage{rotating,graphicx} % allows for landscape tables
\usepackage{adjustbox}
\usepackage{pdflscape} % Used to allow landscape pages
\usepackage{array}
\newcolumntype{R}[2]{%
    >{\adjustbox{angle=#1,lap=\width-(#2)}\bgroup}%
    l%
    <{\egroup}%
}
\newcommand*\rot{\multicolumn{1}{R{45}{1em}}}% no optional argument here, please!

答案1

正如@TeddyvanJerry在评论中指出的那样,问题在于双线的规范,||,必须在\multicolumn最后一列的命令中重复,并且在 的定义中隐藏了一个\rot。我将展示两种解决方案:一种是使用额外的参数来\rot移交这个额外的规范,另一种是使用 完成框架\fbox

第三个参数的解决方案\rot该命令的用法分别为\rot{90}{1em}{}\rot{90}{1em}{||}在此处输入图片描述

\begin{landscape}
\renewcommand*\rot[3]{\multicolumn{1}{R{#1}{#2}#3}}%
%
\begin{tabular}{||p{10cm}cccccccccc||}
\hline\hline
NEEDS \& EXPECTATIONS OF INTERESTED PARTIES &
   \rot{90}{1em}{}{Employees \& Contractors} &
   \rot{90}{1em}{}{Customers, Clients \& Suppliers} &
   \rot{90}{1em}{}{Regulators} &
   \rot{90}{1em}{}{Registrar} &
   \rot{90}{1em}{}{Generators} &
   \rot{90}{1em}{}{General Public, Media \& NGOs} &
   \rot{90}{1em}{}{Neighboring Businesses} &
   \rot{90}{1em}{}{Insurers} &
   \rot{90}{1em}{}{Emergency Response Services} &
   \rot{90}{1em}{||}{Industry Associations}   \\ [0.5ex]
\hline\hline                                            
1. Expect to work in a safe and healthy environment &   X &      &   &   &   &   &   &   &   &      \\
\hline\hline
\end{tabular}
\end{landscape}

解决方案\fbox完全删除规范|以及外部的\hlines。 在此处输入图片描述

\begin{landscape}
\renewcommand*\rot[2]{\multicolumn{1}{R{#1}{#2}}}%
%
\fboxsep2pt%
\fbox{\fbox{%
\begin{tabular}{p{10cm}cccccccccc}
NEEDS \& EXPECTATIONS OF INTERESTED PARTIES &
   \rot{90}{1em}{Employees \& Contractors} &
   \rot{90}{1em}{Customers, Clients \& Suppliers} &
   \rot{90}{1em}{Regulators} &
   \rot{90}{1em}{Registrar} &
   \rot{90}{1em}{Generators} &
   \rot{90}{1em}{General Public, Media \& NGOs} &
   \rot{90}{1em}{Neighboring Businesses} &
   \rot{90}{1em}{Insurers} &
   \rot{90}{1em}{Emergency Response Services} &
   \rot{90}{1em}{Industry Associations}   \\ [0.5ex]
\hline\hline                                            
1. Expect to work in a safe and healthy environment &   X &      &   &   &   &   &   &   &   &      
\end{tabular}%
}}

相关内容