Featured Book

LaTeX Beginners Guide

Who is online

In total there are 6 users online :: 1 registered, 0 hidden and 5 guests (based on users active over the past 5 minutes)
Most users ever online was 1327 on Tue Nov 05, 2013 7:11 pm

Users browsing this forum: Yahoo [Bot] and 5 guests

Partner Sites

TeXwelt - Fragen und Antworten goLaTeX
TeXblog
TeXnicCenter
TeXample

removing vertical lines in tables

Add tags Information and discussion about graphics, figures & tables in LaTeX documents.

removing vertical lines in tables

Postby suzanne hugo on Wed Jan 28th, 2009

i want to make a table that only has continuous vertical lines that span a part of the table and not the whole table, for example from rows 4 to 8. As far as i know, when the tabular environment is created, you have to declare where the vertical lines go and so these vertical lines span the entire length of the table. To be more specific, i want to do for vertical lines what \cline does for horizontal lines. i have searched the internet for resources such as this and can't seem to find anything. please help.
suzanne hugo
 
Posts: 7
Joined: Wed Jan 28th, 2009

Re: removing vertical lines in tables

Postby localghost on Wed Jan 28th, 2009

You should avoid vertical lines in general to improve readability of your tables. Show us an example (code) and describe exactly where you want to remove those lines.


Best regards and welcome to the board
Thorsten¹
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses
User avatar
localghost
Site Moderator
 
Posts: 9219
Joined: Fri Feb 2nd, 2007
Location: Braunschweig, Germany

Re: removing vertical lines in tables

Postby suzanne hugo on Wed Jan 28th, 2009

Okay, here is an example of what the table does at the moment...i would like to remove the vertical line on the right for the first two rows, so that the numbers are enclosed in a box, with the labels on the outside. Thank you!

Code: Select all  •  Open in writeLaTeX
\begin{tabular}{c c|c c c c|}
  \multicolumn{2}{c}{} & Piano & Trumpet & Flute & Viola\\
  \multicolumn{2}{c}{}& \textbf{pno} & \textbf{tpt} & \textbf{flt} & \textbf{vla}\\
  \cline{3-6}
  Piano & \textbf{pno} & 0 & 0.5 & 0.25 & 0.75\\
  Trumpet & \textbf{tpt} & 0 & 0 & 0.25 & 0.5\\
  Flute & \textbf{flt} & 0 & 0 & 0 & 0.75\\
  Viola & \textbf{vla} & 0& 0 & 0 & 0\\
  \cline{3-6}
\end{tabular
}
suzanne hugo
 
Posts: 7
Joined: Wed Jan 28th, 2009

Re: removing vertical lines in tables

Postby Keta on Wed Jan 28th, 2009

You can put these cells inside a multicolumn of just one column:

Code: Select all  •  Open in writeLaTeX
\documentclass[a4paper]{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\begin{document}

\begin{tabular}{c c|c c c c|}
\multicolumn{2}{c}{} & Piano & Trumpet & Flute & \multicolumn{1}{c}{Viola}\\
\multicolumn{2}{c}{}& \textbf{pno} & \textbf{tpt} & \textbf{flt} & \multicolumn{1}{c}{\textbf{vla}}\\
\cline{3-6}
Piano & \textbf{pno} & 0 & 0.5 & 0.25 & 0.75\\
Trumpet & \textbf{tpt} & 0 & 0 & 0.25 & 0.5\\
Flute & \textbf{flt} & 0 & 0 & 0 & 0.75\\
Viola & \textbf{vla} & 0& 0 & 0 & 0\\
\cline{3-6}
\end{tabular}

\end{document
}
Keta
 
Posts: 63
Joined: Tue Nov 25th, 2008

Re: removing vertical lines in tables

Postby suzanne hugo on Wed Jan 28th, 2009

thank you so much, it works perfectly!
suzanne hugo
 
Posts: 7
Joined: Wed Jan 28th, 2009


Return to Graphics, Figures & Tables

Who is online

Users browsing this forum: Yahoo [Bot] and 5 guests