Graphics, Figures & TablesBold lines in table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
s221088
Posts: 1
Joined: Wed Sep 28, 2022 5:37 am

Bold lines in table

Post by s221088 »

Hey!
I tried to make bolt lines in a table in this document:
https://www.overleaf.com/read/ydjqwtxjzfqd

But as you see in the upper left corner, there is missing a small piece... I tried to solve it for a couple of hours but couldn't find any solutions. Any ideas?

This is the code for the objects that didn't work...

Code: Select all

\multicolumn{3}{|c}{10 simulationer}{\vrule width 3pt}&\multicolumn{3}{c}{15 simulationer}{\vrule width 3pt}&\multicolumn{3}{c}{25 simulationer}{\vrule width 3pt}&\multicolumn{3}{c}{50 simulationer}{\vrule width 2pt}& \multicolumn{3}{c}{100 simulationer}{\vrule width 2pt}\\ \hline
Best regards and thanks in advance!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

Bold lines in table

Post by Bartman »

I'd like to recommend you to limit the lines to horizontal ones and add them using the already loaded booktabs package.

The command for the vertical line is missing in the argument of the first \multicolumn command in your table.

Code: Select all

\documentclass[8pt]{extarticle}
\usepackage[
  a4paper,
  total={170mm,257mm},
  left=10mm,
  top=20mm,
  right=10mm,
  showframe
]{geometry}

% Both packages are already loaded by the Pakker.tex file in the preamble.
\usepackage{array}
\usepackage{makecell}

\begin{document}
\begin{table}[!ht]
  \centering
  % An alternative to using the \scalebox command 
  % to fit the table into the page width.
  \small
  \renewcommand{\theadfont}{}% provided by makecell package
  \renewcommand{\arraystretch}{1.3}
  \begin{tabular}{
    *5{!{\vrule width 2pt}c|c|c}
    !{\vrule width 2pt}
  }
  \noalign{\hrule height 2pt}
  \multicolumn{3}{!{\vrule width 2pt}c}{10 simulationer}{\vrule width 2pt}&
  \multicolumn{3}{c}{15 simulationer}{\vrule width 2pt}&
  \multicolumn{3}{c}{25 simulationer}{\vrule width 2pt}&
  \multicolumn{3}{c}{50 simulationer}{\vrule width 2pt}& 
  \multicolumn{3}{c}{100 simulationer}{\vrule width 2pt}\\ \hline
        
  Forsøg & Score & \thead[t]{Største\\brik} & 
  Forsøg & Score & \thead[t]{Største\\brik} & 
  Forsøg & Score & \thead[t]{Største\\brik} & 
  Forsøg & Score & \thead[t]{Største\\brik} & 
  Forsøg & Score & \thead[t]{Største\\brik}\\ 
  \hline
  \noalign{\hrule height 2pt}
  1 & 6540 & 512 & 1 & 6688 & 512 & 1 & 4968 & 512 & 1 & 14856 & 1024 & 1 & 48896 & 4096 \\ 
  \hline
  2 & 6832 & 512 & 2 & 13608 & 1024 & 2 & 15036 & 1024 & 2 & 6708 & 512 & 2 & 30436 & 2048 \\ 
  \hline
  \noalign{\hrule height 2pt}
  \end{tabular}
\end{table}
\end{document}
A note on cross-references: At least the naming of cross-references to tables is supported by the \autoref command of the hyperref package for your language. In most cases, the latter should be loaded last and not in the middle as in the preamble.
Post Reply