Featured Book

LaTeX Beginners Guide

Who is online

In total there are 4 users online :: 0 registered, 0 hidden and 4 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: No registered users and 4 guests

Partner Sites

TeXwelt - Fragen und Antworten goLaTeX
TeXblog
TeXnicCenter
TeXample

Thick vertical lines in tabular Topic is solved

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

Thick vertical lines in tabular

Postby pooley343 on Thu Nov 20th, 2008

I am trying to make a table but with thicker lines for all the outer lines. All of the packages suggest that you should never, ever use vertical lines and don't support thicker vertical lines...well what if I need to?!

I've found and example of what I want but it is written in TeX...

Code: Select all  •  Open in writeLaTeX
{
\offinterlineskip
\tabskip=0pt
\halign{
\vrule height2.75ex depth1.25ex width 1pt #\tabskip=1em &
\hfil 0.#\hfil &\vrule # & \qquad$0.#\,\pi$\hfil &\vrule # &
\hfil 0.#\hfil &#\vrule width 1pt \tabskip=0pt\cr
\noalign{\hrule height 1pt}
& \omit$\alpha_s$ &&\omit star angle && \omit diquark size [fm] & \cr
\noalign{\hrule}
& 3 && 22 && 34 &\cr
& 4 && 14 && 22 &\cr
& 5 && 095 && 15 &\cr
\noalign{\hrule height 1pt}
}
}


Any Help?
Last edited by cgnieder on Thu Nov 22nd, 2012, edited 1 time in total.
Reason: code marked
pooley343
 
Posts: 17
Joined: Mon Oct 20th, 2008

Re: Thick vertical lines in tabular

Postby gmedina on Thu Nov 20th, 2008

Hi,

the following example illustrates one possibility:
Code: Select all  •  Open in writeLaTeX
\documentclass{article}
\usepackage{array}

\begin{document}

\begin{center}
  \renewcommand{\arraystretch}{1.3}
  \begin{tabular}{!{\vrule width 2pt}c|c|c!{\vrule width 2pt
}c|c|c%
  !{\vrule width 2pt}c|c|c!{\vrule width 2pt}}
    \noalign{\hrule height 2pt}
    1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\ \hline
    1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\ \hline
    1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\ \noalign{\hrule height 2pt}
    1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\ \hline
    1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\ \hline
    1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\ \noalign{\hrule height 2pt}
    1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\ \hline
    1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\ \hline
    1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\ \noalign{\hrule height 2pt}
  \end{tabular}
\end{center}

\end{document
}

To change a vertical line's width, use
Code: Select all  •  Open in writeLaTeX
!{\vrule width <unit>}
instead of the symbol "|"
To change a horizontal line's width, use
Code: Select all  •  Open in writeLaTeX
\noalign{\hrule height <unit>}
instead of \hline
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
gmedina
 
Posts: 2313
Joined: Wed Jul 11th, 2007
Location: Colombia

Re: Thick vertical lines in tabular

Postby curiouslearn on Sun Dec 14th, 2008

Gmedina, thanks very much for this old post of yours. This morning I was looking for how to increase the line width of vertical lines in tables. I spent a lot of time searching and only found people giving advice about why there should be no vertical lines in tables, which was useless to me since normal form representations of games in Game theory often have vertical lines. Then I came across this helpful post of yours, on this ever helpful forum.
curiouslearn
 
Posts: 105
Joined: Fri Nov 30th, 2007

Re: Thick vertical lines in tabular

Postby localghost on Sun Dec 14th, 2008

curiouslearn wrote:[...] I spent a lot of time searching and only found people giving advice about why there should be no vertical lines in tables, which was useless to me since normal form representations of games in Game theory often have vertical lines. [...]

Avoiding vertical lines is still true for tables containing normal text to improve readability. If the special purpose of a table is made clear right at the beginning, nobody will refuse to help in creating a table with vertical lines.


Best regards
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: Thick vertical lines in tabular

Postby curiouslearn on Mon Dec 15th, 2008

Thanks, Thorsten. I understand. Can someone please tell me how I can use the thickness of \cline lines, that is lines which only span a few columns. Alternatively, how can the thicker horizontal lines drawn using the method suggested by gmedina can be restricted to only a few columns.

Thanks for any help.
curiouslearn
 
Posts: 105
Joined: Fri Nov 30th, 2007

Re: Thick vertical lines in tabular  Topic is solved

Postby Juanjo on Sun Dec 21st, 2008

Add this to the preamble:
Code: Select all  •  Open in writeLaTeX
\newlength{\arrayrulewidthOriginal}
\newcommand{\Cline
}[2]{%
  \noalign{\global\setlength{\arrayrulewidthOriginal}{\arrayrulewidth}}%
  \noalign{\global\setlength{\arrayrulewidth}{#1}}\cline{#2}%
  \noalign{\global\setlength{\arrayrulewidth}{\arrayrulewidthOriginal}}}

Then write, for example, \Cline{2pt}{4-7} where you would use \cline{4-7}.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
User avatar
Juanjo
 
Posts: 656
Joined: Sat Jan 27th, 2007

Re: Thick vertical lines in tabular

Postby Da Masda on Thu Nov 22nd, 2012

THANKS, Juanjo, this is exactly what I have been looking for :)
This definitely is the easiest way to handle table line thickness. GREAT!
Da Masda
 
Posts: 2
Joined: Thu Nov 22nd, 2012


Return to Graphics, Figures & Tables

Who is online

Users browsing this forum: No registered users and 4 guests