Here you have a simple example; the idea is to use \noalign{\hrule height <length>}
instead of \hline
to get a horixontal rule of thickness given by <length>
; for a vertical rule, not spanning the whole table, the idea is to use \multicolumn and in the second argument to use !{\vrule width <length>}
instead of |
to get a vertical rule of thickness given by <length>
for that cell (the array
package is required for this last construction):
\documentclass{article}
\usepackage{array}
\begin{document}
\begin{tabular}{|c|c|}
\hline
column1a & column2a \\
\noalign{\hrule height 2pt}
\multicolumn{1}{!{\vrule width 2pt}c!{\vrule width 1pt}}{column1b} &
\multicolumn{1}{!{\vrule width 1pt}c!{\vrule width 2pt}}{column2b} \\
\noalign{\hrule height 2pt}
column1c & column2c \\
\hline
\end{tabular}
\end{document}
And here's an example with your table:
\documentclass{article}
\usepackage{array}
\begin{document}
\begin{table*}
{\normalsize
\hfill{}
\large
\begin{tabular}{|c|c|c|c|c|}
\hline \bf ID & \bf Raw Score & \bf Num & \bf Total Hits & \bf Avg \\
\hline 217842950 & 8282 & 9 & 10059 & 0.176658 \\
\hline 264307945 & 7700 & 13 & 11076 & 0.304803 \\
\noalign{\hrule height 2pt}
\multicolumn{1}{!{\vrule width 2pt}c!{\vrule width 1pt}}{111824111} &
\multicolumn{1}{!{\vrule width 1pt}c!{\vrule width 1pt}}{6170} &
\multicolumn{1}{!{\vrule width 1pt}c!{\vrule width 1pt}}{16} &
\multicolumn{1}{!{\vrule width 1pt}c!{\vrule width 1pt}}{9467} &
\multicolumn{1}{!{\vrule width 1pt}c!{\vrule width 2pt}}{0.348262} \\
\noalign{\hrule height 2pt}
\multicolumn{1}{!{\vrule width 2pt}c!{\vrule width 1pt}}{331180650} &
\multicolumn{1}{!{\vrule width 1pt}c!{\vrule width 1pt}}{1705} &
\multicolumn{1}{!{\vrule width 1pt}c!{\vrule width 1pt}}{31} &
\multicolumn{1}{!{\vrule width 1pt}c!{\vrule width 1pt}}{2668} &
\multicolumn{1}{!{\vrule width 1pt}c!{\vrule width 2pt}}{0.360945} \\
\noalign{\hrule height 2pt}
436114131 & 1540 & 6 & 1773 & 0.131416 \\
\hline 546694115 & 1460 & 6 & 1685 & 0.133531 \\
\hline 467026458 & 1058 & 36 & 1237 & 0.144705 \\
\hline
\end{tabular} }
\hfill{}
\caption{Scores for the top-7 IDs .}
\label{tb:tablename}
\end{table*}
\end{document}
Of course, you can define macros such as:
\newcommand\Thickvrule[1]{%
\multicolumn{1}{!{\vrule width 2pt}c!{\vrule width 1pt}}{#1}%
}
and then use
\Thickvrule{6170}
in your document.
For just some cells, a variant of \cline
with the desired thickness can be defined:
\documentclass{article}
\usepackage{array}
\newlength\Origarrayrulewidth
\newcommand{\Cline}[1]{%
\noalign{\global\setlength\Origarrayrulewidth{\arrayrulewidth}}%
\noalign{\global\setlength\arrayrulewidth{2pt}}\cline{#1}%
\noalign{\global\setlength\arrayrulewidth{\Origarrayrulewidth}}%
}
\newcommand\Thickvrule[1]{%
\multicolumn{1}{!{\vrule width 2pt}c!{\vrule width 2pt}}{#1}%
}
\begin{document}
\begin{table*}
\setlength\extrarowheight{3pt}
\large
\centering
\begin{tabular}{|c|c|c|c|c|}
\hline \bf ID & \bf Raw Score & \bf Num & \bf Total Hits & \bf Avg \\
\hline 217842950 & 8282 & 9 & 10059 & 0.176658 \\
\Cline{1-1}\cline{2-5}
\Thickvrule{264307945} & 7700 & 13 & 11076 & 0.304803 \\
\Cline{1-1}\cline{2-4}\Cline{4-4}\cline{4-5}
111824111 & 6170 & 16 & \Thickvrule{9467} & 0.348262 \\
\cline{1-4}\Cline{4-4}\cline{4-5}
331180650 & 1705 & 31 & 2668 & 0.360945 \\
\hline 436114131 & 1540 & 6 & 1773 & 0.131416 \\
\cline{1-2}\Cline{2-2}\cline{3-5}
546694115 & \Thickvrule{1460} & 6 & 1685 & 0.133531 \\
\cline{1-2}\Cline{2-2}\cline{3-5}
467026458 & 1058 & 36 & 1237 & 0.144705 \\
\hline
\end{tabular}
\caption{Scores for the top-7 IDs .}
\label{tb:tablename}
\end{table*}
\end{document}
And some other macros for the case of more than one cell:
\documentclass{article}
\usepackage{array}
\newlength\Origarrayrulewidth
% horizontal rule equivalent to \cline but with 2pt width
\newcommand{\Cline}[1]{%
\noalign{\global\setlength\Origarrayrulewidth{\arrayrulewidth}}%
\noalign{\global\setlength\arrayrulewidth{2pt}}\cline{#1}%
\noalign{\global\setlength\arrayrulewidth{\Origarrayrulewidth}}%
}
% draw a vertical rule of width 2pt on both sides of a cell
\newcommand\Thickvrule[1]{%
\multicolumn{1}{!{\vrule width 2pt}c!{\vrule width 2pt}}{#1}%
}
% draw a vertical rule of width 2pt on the left side of a cell
\newcommand\Thickvrulel[1]{%
\multicolumn{1}{!{\vrule width 2pt}c|}{#1}%
}
% draw a vertical rule of width 2pt on the right side of a cell
\newcommand\Thickvruler[1]{%
\multicolumn{1}{|c!{\vrule width 2pt}}{#1}%
}
\begin{document}
\begin{table*}
\setlength\extrarowheight{3pt}
\centering
\large
\begin{tabular}{|c|c|c|c|c|}
\hline \bf ID & \bf Raw Score & \bf Num & \bf Total Hits & \bf Avg \\
\hline 217842950 & 8282 & 9 & 10059 & 0.176658 \\
\Cline{1-1}\cline{2-5}
\Thickvrule{264307945} & 7700 & 13 & 11076 & 0.304803 \\
\Cline{1-1}\cline{2-4}\Cline{4-4}\cline{4-5}
111824111 & 6170 & 16 & \Thickvrule{9467} & 0.348262 \\
\cline{1-4}\Cline{4-4}\cline{4-5}
331180650 & 1705 & 31 & 2668 & 0.360945 \\
\cline{1-2}\Cline{2-2}\cline{3-5}
436114131 & \Thickvrule{1540} & 6 & 1773 & 0.131416 \\
\cline{1-2}\Cline{2-2}\cline{3-5}
546694115 & 1460 & 6 & 1685 & 0.133531 \\
\Cline{1-5}
\Thickvrulel{467026458} & 1058 & 36 & 1237 & \Thickvruler{0.144705} \\
\Cline{1-5}
\end{tabular}
\caption{Scores for the top-7 IDs .}
\label{tb:tablename}
\end{table*}
\end{document}
Finally, as a side note, you should consider not using vertical rules in your tables (this is only a suggestion, of course); with the help of the booktabs
package you can easily produce beautiful tables.
To get a cell spanning several rows, you can use the multirow
package. \backslashbox
works well with this within its implemantion limits - the slash is constructed as a LaTeX picture, and so there are only a limited number of slopes for the line allowed.
\documentclass[12pt]{article}
\usepackage{slashbox,multirow}
\begin{document}
\begin{table}[htbp]
\begin{center}
\begin{tabular}[htp]{||l|c|c|c|c||}
\hline
\multirow{4}{*}{\backslashbox{Adult\\\strut person}{\strut Motion\\ types}}
& can definitely & \multicolumn{2}{c|}{can definitely } & can definitely\\
& walk & \multicolumn{2}{c|}{jump} & run\\
\cline {3-4} & & more than & more than & \\
& & 10 cm & 20 cm &\\
\hline \hline
Joe & Yes & No & No & No \\
Margaret & Yes & Yes & Yes & Yes \\
\hline
\end{tabular}
\end{center}
\end{table}
\end{document}
A more sophisticated solution with, more flexible choices of slash line, would use something like tikz
, see Diagonal lines in table cell for some such approaches, but would still require such a \multirow
command.
Best Answer
This is a conceptual and kind of a manual solution. We first inject
\tikzmark
s into the column seperators and then use them to draw over the table which sits in a TikZ node.