In a table, how can I draw a horizontal line that goes only through some of the cells? I mean a line like the one in the Foo
and in the Bar
area of this table:
+----+-----+
|Foo |1 |2 |
| |1 |2 |
| +--+--+
| |1 |2 |
| |1 |2 |
+----+-----+
|Bar |1 |2 |
| |1 |2 |
| +--+--+
| |1 |2 |
| |1 |2 |
+----+--+--+
Best Answer
Instead of nested tables as xport_is_sleeping suggested, you can also use
\cline{2-3}
which draws a partial line starting on column 2 and ending on column 3 and use\multirow
to center the wordsFoo
andBar
on the lines if that's what you want:When making tables, you should also always use the array package which offers various additional features and improvements (most notably at the vertical and horizontal lines joins).