LaTeX forum ⇒ Graphics, Figures & TablesThick vertical lines in tabular Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
pooley343
Posts: 17
Joined: Mon Oct 20, 2008 2:53 pm

Thick vertical lines in tabular

Postby pooley343 » Thu Nov 20, 2008 11:38 am

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...

  1. {
  2. \offinterlineskip
  3. \tabskip=0pt
  4. \halign{
  5. \vrule height2.75ex depth1.25ex width 1pt #\tabskip=1em &
  6. \hfil 0.#\hfil &\vrule # & \qquad$0.#\,\pi$\hfil &\vrule # &
  7. \hfil 0.#\hfil &#\vrule width 1pt \tabskip=0pt\cr
  8. \noalign{\hrule height 1pt}
  9. & \omit$\alpha_s$ &&\omit star angle && \omit diquark size [fm] & \cr
  10. \noalign{\hrule}
  11. & 3 && 22 && 34 &\cr
  12. & 4 && 14 && 22 &\cr
  13. & 5 && 095 && 15 &\cr
  14. \noalign{\hrule height 1pt}
  15. }}


Any Help?
Last edited by cgnieder on Thu Nov 22, 2012 2:30 pm, edited 1 time in total.
Reason: code marked

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm
Location: Colombia

Postby gmedina » Thu Nov 20, 2008 3:20 pm

Hi,

the following example illustrates one possibility:
  1. \documentclass{article}
  2. \usepackage{array}
  3.  
  4. \begin{document}
  5.  
  6. \begin{center}
  7. \renewcommand{\arraystretch}{1.3}
  8. \begin{tabular}{!{\vrule width 2pt}c|c|c!{\vrule width 2pt}c|c|c%
  9. !{\vrule width 2pt}c|c|c!{\vrule width 2pt}}
  10. \noalign{\hrule height 2pt}
  11. 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\ \hline
  12. 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\ \hline
  13. 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\ \noalign{\hrule height 2pt}
  14. 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\ \hline
  15. 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\ \hline
  16. 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\ \noalign{\hrule height 2pt}
  17. 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\ \hline
  18. 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\ \hline
  19. 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\ \noalign{\hrule height 2pt}
  20. \end{tabular}
  21. \end{center}
  22.  
  23. \end{document}

To change a vertical line's width, use
  1. !{\vrule width <unit>}
instead of the symbol "|"
To change a horizontal line's width, use
  1. \noalign{\hrule height <unit>}
instead of \hline
1,1,2,3,5,8,13,21,34,55,89,144,233,...

Link:
BBcode:
HTML:
Hide post links
Show post links

curiouslearn
Posts: 105
Joined: Fri Nov 30, 2007 11:32 pm

Postby curiouslearn » Sun Dec 14, 2008 10:16 pm

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.

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Sun Dec 14, 2008 10:49 pm

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

Link:
BBcode:
HTML:
Hide post links
Show post links

curiouslearn
Posts: 105
Joined: Fri Nov 30, 2007 11:32 pm

Postby curiouslearn » Mon Dec 15, 2008 1:33 am

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.

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Juanjo
Posts: 656
Joined: Sat Jan 27, 2007 12:46 am

Postby Juanjo » Sun Dec 21, 2008 1:24 am

Add this to the preamble:
  1. \newlength{\arrayrulewidthOriginal}
  2. \newcommand{\Cline}[2]{%
  3. \noalign{\global\setlength{\arrayrulewidthOriginal}{\arrayrulewidth}}%
  4. \noalign{\global\setlength{\arrayrulewidth}{#1}}\cline{#2}%
  5. \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.

Link:
BBcode: Topic is solved[/url]" title="Click to select post's link in BBcode format" onclick="this.focus();this.select();" />
HTML: Topic is solved</a>" title="Click to select post's link in HTML format" onclick="this.focus();this.select();" />
Hide post links
Show post links

Da Masda
Posts: 2
Joined: Thu Nov 22, 2012 1:56 pm

Postby Da Masda » Thu Nov 22, 2012 2:01 pm

THANKS, Juanjo, this is exactly what I have been looking for :)
This definitely is the easiest way to handle table line thickness. GREAT!

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 5 guests