Skip to content

long tables: customization of rule width/thickness #49

Closed

Description

@DAbidou

For long tables, it would be great if I could make the width/thickness of the rules encompassing the first header different from those of the repeated headers. Also, the same is desired for the repeated footers and last footer.

Activity

  1. lvjr commented on Aug 3, 2021

    @lvjr
    Collaborator

    You can create your special tabularray environment and add extra rules to first head and last foot:

    \documentclass{article}
    
    \usepackage[paperwidth=8cm,paperheight=6cm,width=7cm,height=5cm]{geometry}
    \usepackage{tabularray,xcolor}
    \UseTblrLibrary{booktabs}
    
    \begin{document}
    
    \DefTblrTemplate{firsthead}{mytemplate}{
      \UseTblrTemplate{caption}{default}
      \vskip 6pt
      \hrule height 1pt
    }
    
    \DefTblrTemplate{middlehead,lasthead}{mytemplate}{
      \UseTblrTemplate{capcont}{default}
      \vskip 6pt
    }
    
    \DefTblrTemplate{firstfoot,middlefoot}{mytemplate}{
      \vskip 6pt
      \UseTblrTemplate{contfoot}{default}
    }
    
    \DefTblrTemplate{lastfoot}{mytemplate}{
      \hrule height 1pt width \tablewidth
      \vskip 6pt
      \UseTblrTemplate{note}{default}
      \UseTblrTemplate{remark}{default}
    }
    
    \NewTblrTheme{mytheme}{
      \SetTblrTemplate{head,foot}{mytemplate}
    }
    
    \NewTblrEnviron{mytblr}
    \SetTblrOuter[mytblr]{long,headsep=0pt,footsep=0pt,theme=mytheme}
    
    \begin{mytblr}[
      caption = {The Caption},
    ]{
      colspec = {XX}, rowhead = 1,
      row{even} = {gray!30}, row{1} = {blue!15},
    }
    \toprule[1.5pt]
      One & Two  \\
    \midrule
       1  &   2  \\
       3  &   4  \\
       5  &   6  \\
       7  &   8  \\
       9  &  10  \\
      11  &  12  \\
      13  &  14  \\
      15  &  16  \\
      17  &  18  \\
      19  &  20  \\
    \bottomrule[1.5pt]
    \end{mytblr}
    
    \end{document}

    image

  2. locked and limited conversation to collaborators on Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions