
如何刪除列中最右邊的行線。我看過他們在左邊做的例子。我想要來自的“權力”這裡的桌子位於右側而不是左側。
我有以下程式碼:
\documentclass[a4paper,oneside,11pt]{memoir}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{multirow}
\begin{document}
\renewcommand{\arraystretch}{1.5}%controls the space between the rows
\begin{table}[h!]
\begin{center}
\begin{tabular}{ | l | l | l | l |}
\hline
\textbf{header one} & \textbf{header two} & \textbf{header three} & \textbf{header four}\\ \hline
r1c1 & r1c2 & r1c3 & \multirow{4}{*}{ no row lines in the first four rows}\\ \hline
r2c1 & r2c2 & r2c3 & \\ \hline
r3c1 & r3c2 & r3c3 &\\ \hline
r4c1 & r4c2 & r4c3 &\\ \hline
r5c1 & r5c2 & r5c3 &\\ \hline
r6c1 & r6c2 & r6c3 &\\ \hline
r7c1 & r7c2 & r7c3 &\\ \hline
\end{tabular}
\caption{my caption}
\label{tab:test}
\end{center}
\end{table}
\end{document}
文字“前四行中沒有行線”應該......好吧,沒有行線 - 它應該是一個“大盒子”:o)所有幫助都非常有用!
答案1
使用
\cline{1-3}
成行2-4
而不是\hline
% arara: pdflatex
\documentclass{article}
\usepackage{multirow}
\begin{document}
\renewcommand{\arraystretch}{1.5}%controls the space between the rows
\begin{table}[h!]
\begin{center}
\begin{tabular}{ | l | l | l | l |}
\hline
\textbf{header one} & \textbf{header two} & \textbf{header three} & \textbf{header four}\\ \hline
r1c1 & r1c2 & r1c3 & \multirow{4}{*}{ no row lines in the first four rows}\\ \cline{1-3}
r2c1 & r2c2 & r2c3 & \\ \cline{1-3}
r3c1 & r3c2 & r3c3 &\\\cline{1-3}
r4c1 & r4c2 & r4c3 &\\ \hline
r5c1 & r5c2 & r5c3 &\\ \hline
r6c1 & r6c2 & r6c3 &\\ \hline
r7c1 & r7c2 & r7c3 &\\ \hline
\end{tabular}
\caption{my caption}
\label{tab:test}
\end{center}
\end{table}
\end{document}
table
可以透過使用來進一步增強您的booktabs
包,並注意到來自的答案
% arara: pdflatex
% !arara: indent: {overwrite: true}
\documentclass{article}
\usepackage{multirow}
\usepackage{booktabs}
\begin{document}
\renewcommand{\arraystretch}{1.5}%controls the space between the rows
\begin{table}[h!]
\centering
\caption{my caption}
\label{tab:test}
\begin{tabular}{ l l l l }
\toprule
\textbf{header one} & \textbf{header two} & \textbf{header three} & \textbf{header four} \\ \midrule
r1c1 & r1c2 & r1c3 & \multirow{4}{*}{ no row lines in the first four rows} \\ \cmidrule{1-3}
r2c1 & r2c2 & r2c3 & \\ \cmidrule{1-3}
r3c1 & r3c2 & r3c3 & \\\cmidrule{1-3}
r4c1 & r4c2 & r4c3 & \\ \midrule
r5c1 & r5c2 & r5c3 & \\ \midrule
r6c1 & r6c2 & r6c3 & \\ \midrule
r7c1 & r7c2 & r7c3 & \\ \bottomrule
\end{tabular}
\end{table}
\end{document}