I'm using two custom table rules to reproduce the following table:
The codes below have problems at the edges, how to avoid the rules from producing extra spaces and extra length.
\documentclass{article}
\usepackage{array}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{amsmath}
\usepackage{fourier}
\usepackage{setspace}
\setstretch{1.5}
\DeclareMathOperator{\im}{im}
\makeatletter
\newcommand{\Lmidrule}{%
\noalign {\ifnum 0=`}\fi \hrule height .55pt
\futurelet \reserved@a \@xhline
}
\newcolumntype{"}{@{\hskip\tabcolsep\vrule width .65pt\hskip\tabcolsep}}
\makeatother
\makeatletter
\def\Cline#1#2{\@Cline#1#2\@nil}
\def\@Cline#1-#2#3\@nil{%
\omit
\@multicnt#1%
\advance\@multispan\m@ne
\ifnum\@multicnt=\@ne\@firstofone{&\omit}\fi
\@multicnt#2%
\advance\@multicnt-#1%
\advance\@multispan\@ne
\leaders\hrule\@height#3\hfill
\cr}
\makeatother
\begin{document}
\begin{center}
\begin{tabular}{c"c"c"c"c"c"c"c"c}\toprule
& $V_1$ & $V_2$ & $\cdots$ & $V_k$ & $V_{k+1}$ & $\cdots$ & $V_m$
\\\Lmidrule
& $\alpha_1$ & $\alpha_2$ & $\cdots$ & $\alpha_k$ &&&&
\\\Cline{1-5}{.55pt}
\multirow{4}{*}{$\im T$} & $T\alpha_1$ & $T\alpha_2$ & $\cdots$ & $T\alpha_k$ &&&&
\\
& $\vdots$ & $\vdots$ & & $\vdots$ &&&& $V/\ker T$
\\
& $T^{l_1-2}\alpha_1$ & $T^{l_2-2}\alpha_2$ & $\cdots$ & $T^{l_k-2}\alpha_k$&&&&
\\\Cline{2-9}{.55pt}
& $T^{l_1-1}\alpha_1$ & $T^{l_2-1}\alpha_2$ & $\cdots$ & $T^{l_k-1}\alpha_k$
& $\alpha_{k+1}$ & $\cdots$ & $\alpha_m$ & $\ker T$
\\\bottomrule
\end{tabular}
\end{center}
\end{document}
The custom rules are from:




booktabswith vertical rules. see the documentation for an explanation. note that this is by design: professional quality tables do not have vertical rules. (not that I think thebooktabsposition on this is a little extreme, personally, though I'm sympathetic to a moderated version of the claim.)