Let's say I have a table with 4 columns and 8 rows. The top row is the label for each of the rows below. Suppose I want the cell borders for rows 4 and 5 to be thicker than the rest of the cells in the table. Is there a way to accomplish this in LaTeX?
\begin{table*}[ht]
{\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 \\
\hline 111824111 & 6170 & 16 & 9467 & 0.348262 \\
\hline 331180650 & 1705 & 31 & 2668 & 0.360945 \\
\hline 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*}
Above is the table I have. I'm unsure how I would even go about changing the border around any row (or cell)
Best Answer
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 (thearray
package is required for this last construction):And here's an example with your table:
Of course, you can define macros such as:
and then use
in your document.
For just some cells, a variant of
\cline
with the desired thickness can be defined:And some other macros for the case of more than one cell:
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.