I hope this isn't a silly question, the thing is that I want to create a table with a midrule applied in just some cells, I mean something like that (just between Item, Animal and Description):
I've always used the comand midrule
in order to insert a horizontal line in the table, but it is always applied to the whole row and thats just what I don't want to.
I hope somebody could help me out.
Best Answer
booktabs
provides the command\cmidrule
for rules that extend over only certain columns. One example would be:The general syntax is
where
shortening
specifies which end(s)l
left orr
right should be shortened. As standerd the shortening amount is0.5em
whenl
orr
is specified; it can be changed for a given end by writing e.g.r{1em}
instead ofr
.The table in your example is exactly one of the examples in the
booktabs
manual, which also contains the code to generate it, see the top of page 5.