Table: Alternating rowcolours / bandingHow to create alternating rows in a table?Table rows alternating...

Why does AES have exactly 10 rounds for a 128-bit key, 12 for 192 bits and 14 for a 256-bit key size?

Does IPv6 have similar concept of network mask?

Redundant comparison & "if" before assignment

Yosemite Fire Rings - What to Expect?

How to fade a semiplane defined by line?

How could a planet have erratic days?

Why should universal income be universal?

putting logo on same line but after title, latex

The IT department bottlenecks progress. How should I handle this?

Can a stoichiometric mixture of oxygen and methane exist as a liquid at standard pressure and some (low) temperature?

How to explain what's wrong with this application of the chain rule?

Temporarily disable WLAN internet access for children, but allow it for adults

Are Captain Marvel's powers affected by Thanos' actions in Infinity War

How do you make your own symbol when Detexify fails?

How should I respond when I lied about my education and the company finds out through background check?

Can disgust be a key component of horror?

Can I still be respawned if I die by falling off the map?

How much character growth crosses the line into breaking the character

Do the primes contain an infinite almost arithmetic progression?

What exact color does ozone gas have?

Does malloc reserve more space while allocating memory?

Why does the Sun have different day lengths, but not the gas giants?

Does Doodling or Improvising on the Piano Have Any Benefits?

What is the evidence for the "tyranny of the majority problem" in a direct democracy context?



Table: Alternating rowcolours / banding


How to create alternating rows in a table?Table rows alternating between column and notes-rowTable with colored rows alternating every n rowsSideways label for table with alternating row coloursAlternating row color two at a time in tablesAlternating column AND row colors with tabu?Alternating row colours in tabulary?Alternating coloured rows in table - line width of colouring -how do I have alternating background colors for a table?Alternating color in itemize













0















I have a table with over 400 entries. I wanted to make it more readable by colouring the cells in grey and white. I know how to do it with a regular table. But I cannot get it to work with a longtable environment. Thanks!



Below: A two page MWE.



documentclass[11pt]{article}

usepackage[dvipsnames, table]{xcolor}
usepackage{longtable}
usepackage{booktabs}


begin{document}

begin{longtable}{
>{centeringarraybackslash}m{1cm}
>{centeringarraybackslash}m{4cm}
>{centeringarraybackslash}m{7cm}
>{centeringarraybackslash}m{1.8cm}
}

%header
rowcolor[rgb]{ .149, .149, .149}
textcolor[rgb]{ 1, 1, 1}{textbf{ID}} &
textcolor[rgb]{ 1, 1, 1}{textbf{Journal}} &
textcolor[rgb]{ 1, 1, 1}{textbf{Article}} &
textcolor[rgb]{ 1, 1, 1}{textbf{Year}} \
%content
1 & arxiv & Platzhalter & 2019 \
midrule
2 & arxiv & Platzhalter & 2019 \
midrule
3 & arxiv & Platzhalter & 2019 \
midrule
4 & arxiv & Platzhalter & 2019 \
midrule
5 & arxiv & Platzhalter & 2019 \
midrule
6 & arxiv & Platzhalter & 2019 \
midrule
7 & arxiv & Platzhalter & 2019 \
midrule
8 & arxiv & Platzhalter & 2019 \
midrule
9 & arxiv & Platzhalter & 2019 \
midrule
10 & arxiv & Platzhalter & 2019 \
midrule
11 & arxiv & Platzhalter & 2019 \
midrule
12 & arxiv & Platzhalter & 2019 \
midrule
13 & arxiv & Platzhalter & 2019 \
midrule
14 & arxiv & Platzhalter & 2019 \
midrule
15 & arxiv & Platzhalter & 2019 \
midrule
16 & arxiv & Platzhalter & 2019 \
midrule
17 & arxiv & Platzhalter & 2019 \
midrule
18 & arxiv & Platzhalter & 2019 \
midrule
19 & arxiv & Platzhalter & 2019 \
midrule
20 & arxiv & Platzhalter & 2019 \
midrule
21 & arxiv & Platzhalter & 2019 \
midrule
22 & arxiv & Platzhalter & 2019 \
midrule
23 & arxiv & Platzhalter & 2019 \
midrule
24 & arxiv & Platzhalter & 2019 \
midrule
25 & arxiv & Platzhalter & 2019 \
midrule
26 & arxiv & Platzhalter & 2019 \
midrule
27 & arxiv & Platzhalter & 2019 \
midrule
28 & arxiv & Platzhalter & 2019 \
midrule
29 & arxiv & Platzhalter & 2019 \
midrule
30 & arxiv & Platzhalter & 2019 \
midrule
31 & arxiv & Platzhalter & 2019 \
midrule
32 & arxiv & Platzhalter & 2019 \
midrule
33 & arxiv & Platzhalter & 2019 \
midrule
34 & arxiv & Platzhalter & 2019 \
midrule
35 & arxiv & Platzhalter & 2019 \
bottomrule
end{longtable}
label{tab:addlabel}


end{document}









share



























    0















    I have a table with over 400 entries. I wanted to make it more readable by colouring the cells in grey and white. I know how to do it with a regular table. But I cannot get it to work with a longtable environment. Thanks!



    Below: A two page MWE.



    documentclass[11pt]{article}

    usepackage[dvipsnames, table]{xcolor}
    usepackage{longtable}
    usepackage{booktabs}


    begin{document}

    begin{longtable}{
    >{centeringarraybackslash}m{1cm}
    >{centeringarraybackslash}m{4cm}
    >{centeringarraybackslash}m{7cm}
    >{centeringarraybackslash}m{1.8cm}
    }

    %header
    rowcolor[rgb]{ .149, .149, .149}
    textcolor[rgb]{ 1, 1, 1}{textbf{ID}} &
    textcolor[rgb]{ 1, 1, 1}{textbf{Journal}} &
    textcolor[rgb]{ 1, 1, 1}{textbf{Article}} &
    textcolor[rgb]{ 1, 1, 1}{textbf{Year}} \
    %content
    1 & arxiv & Platzhalter & 2019 \
    midrule
    2 & arxiv & Platzhalter & 2019 \
    midrule
    3 & arxiv & Platzhalter & 2019 \
    midrule
    4 & arxiv & Platzhalter & 2019 \
    midrule
    5 & arxiv & Platzhalter & 2019 \
    midrule
    6 & arxiv & Platzhalter & 2019 \
    midrule
    7 & arxiv & Platzhalter & 2019 \
    midrule
    8 & arxiv & Platzhalter & 2019 \
    midrule
    9 & arxiv & Platzhalter & 2019 \
    midrule
    10 & arxiv & Platzhalter & 2019 \
    midrule
    11 & arxiv & Platzhalter & 2019 \
    midrule
    12 & arxiv & Platzhalter & 2019 \
    midrule
    13 & arxiv & Platzhalter & 2019 \
    midrule
    14 & arxiv & Platzhalter & 2019 \
    midrule
    15 & arxiv & Platzhalter & 2019 \
    midrule
    16 & arxiv & Platzhalter & 2019 \
    midrule
    17 & arxiv & Platzhalter & 2019 \
    midrule
    18 & arxiv & Platzhalter & 2019 \
    midrule
    19 & arxiv & Platzhalter & 2019 \
    midrule
    20 & arxiv & Platzhalter & 2019 \
    midrule
    21 & arxiv & Platzhalter & 2019 \
    midrule
    22 & arxiv & Platzhalter & 2019 \
    midrule
    23 & arxiv & Platzhalter & 2019 \
    midrule
    24 & arxiv & Platzhalter & 2019 \
    midrule
    25 & arxiv & Platzhalter & 2019 \
    midrule
    26 & arxiv & Platzhalter & 2019 \
    midrule
    27 & arxiv & Platzhalter & 2019 \
    midrule
    28 & arxiv & Platzhalter & 2019 \
    midrule
    29 & arxiv & Platzhalter & 2019 \
    midrule
    30 & arxiv & Platzhalter & 2019 \
    midrule
    31 & arxiv & Platzhalter & 2019 \
    midrule
    32 & arxiv & Platzhalter & 2019 \
    midrule
    33 & arxiv & Platzhalter & 2019 \
    midrule
    34 & arxiv & Platzhalter & 2019 \
    midrule
    35 & arxiv & Platzhalter & 2019 \
    bottomrule
    end{longtable}
    label{tab:addlabel}


    end{document}









    share

























      0












      0








      0








      I have a table with over 400 entries. I wanted to make it more readable by colouring the cells in grey and white. I know how to do it with a regular table. But I cannot get it to work with a longtable environment. Thanks!



      Below: A two page MWE.



      documentclass[11pt]{article}

      usepackage[dvipsnames, table]{xcolor}
      usepackage{longtable}
      usepackage{booktabs}


      begin{document}

      begin{longtable}{
      >{centeringarraybackslash}m{1cm}
      >{centeringarraybackslash}m{4cm}
      >{centeringarraybackslash}m{7cm}
      >{centeringarraybackslash}m{1.8cm}
      }

      %header
      rowcolor[rgb]{ .149, .149, .149}
      textcolor[rgb]{ 1, 1, 1}{textbf{ID}} &
      textcolor[rgb]{ 1, 1, 1}{textbf{Journal}} &
      textcolor[rgb]{ 1, 1, 1}{textbf{Article}} &
      textcolor[rgb]{ 1, 1, 1}{textbf{Year}} \
      %content
      1 & arxiv & Platzhalter & 2019 \
      midrule
      2 & arxiv & Platzhalter & 2019 \
      midrule
      3 & arxiv & Platzhalter & 2019 \
      midrule
      4 & arxiv & Platzhalter & 2019 \
      midrule
      5 & arxiv & Platzhalter & 2019 \
      midrule
      6 & arxiv & Platzhalter & 2019 \
      midrule
      7 & arxiv & Platzhalter & 2019 \
      midrule
      8 & arxiv & Platzhalter & 2019 \
      midrule
      9 & arxiv & Platzhalter & 2019 \
      midrule
      10 & arxiv & Platzhalter & 2019 \
      midrule
      11 & arxiv & Platzhalter & 2019 \
      midrule
      12 & arxiv & Platzhalter & 2019 \
      midrule
      13 & arxiv & Platzhalter & 2019 \
      midrule
      14 & arxiv & Platzhalter & 2019 \
      midrule
      15 & arxiv & Platzhalter & 2019 \
      midrule
      16 & arxiv & Platzhalter & 2019 \
      midrule
      17 & arxiv & Platzhalter & 2019 \
      midrule
      18 & arxiv & Platzhalter & 2019 \
      midrule
      19 & arxiv & Platzhalter & 2019 \
      midrule
      20 & arxiv & Platzhalter & 2019 \
      midrule
      21 & arxiv & Platzhalter & 2019 \
      midrule
      22 & arxiv & Platzhalter & 2019 \
      midrule
      23 & arxiv & Platzhalter & 2019 \
      midrule
      24 & arxiv & Platzhalter & 2019 \
      midrule
      25 & arxiv & Platzhalter & 2019 \
      midrule
      26 & arxiv & Platzhalter & 2019 \
      midrule
      27 & arxiv & Platzhalter & 2019 \
      midrule
      28 & arxiv & Platzhalter & 2019 \
      midrule
      29 & arxiv & Platzhalter & 2019 \
      midrule
      30 & arxiv & Platzhalter & 2019 \
      midrule
      31 & arxiv & Platzhalter & 2019 \
      midrule
      32 & arxiv & Platzhalter & 2019 \
      midrule
      33 & arxiv & Platzhalter & 2019 \
      midrule
      34 & arxiv & Platzhalter & 2019 \
      midrule
      35 & arxiv & Platzhalter & 2019 \
      bottomrule
      end{longtable}
      label{tab:addlabel}


      end{document}









      share














      I have a table with over 400 entries. I wanted to make it more readable by colouring the cells in grey and white. I know how to do it with a regular table. But I cannot get it to work with a longtable environment. Thanks!



      Below: A two page MWE.



      documentclass[11pt]{article}

      usepackage[dvipsnames, table]{xcolor}
      usepackage{longtable}
      usepackage{booktabs}


      begin{document}

      begin{longtable}{
      >{centeringarraybackslash}m{1cm}
      >{centeringarraybackslash}m{4cm}
      >{centeringarraybackslash}m{7cm}
      >{centeringarraybackslash}m{1.8cm}
      }

      %header
      rowcolor[rgb]{ .149, .149, .149}
      textcolor[rgb]{ 1, 1, 1}{textbf{ID}} &
      textcolor[rgb]{ 1, 1, 1}{textbf{Journal}} &
      textcolor[rgb]{ 1, 1, 1}{textbf{Article}} &
      textcolor[rgb]{ 1, 1, 1}{textbf{Year}} \
      %content
      1 & arxiv & Platzhalter & 2019 \
      midrule
      2 & arxiv & Platzhalter & 2019 \
      midrule
      3 & arxiv & Platzhalter & 2019 \
      midrule
      4 & arxiv & Platzhalter & 2019 \
      midrule
      5 & arxiv & Platzhalter & 2019 \
      midrule
      6 & arxiv & Platzhalter & 2019 \
      midrule
      7 & arxiv & Platzhalter & 2019 \
      midrule
      8 & arxiv & Platzhalter & 2019 \
      midrule
      9 & arxiv & Platzhalter & 2019 \
      midrule
      10 & arxiv & Platzhalter & 2019 \
      midrule
      11 & arxiv & Platzhalter & 2019 \
      midrule
      12 & arxiv & Platzhalter & 2019 \
      midrule
      13 & arxiv & Platzhalter & 2019 \
      midrule
      14 & arxiv & Platzhalter & 2019 \
      midrule
      15 & arxiv & Platzhalter & 2019 \
      midrule
      16 & arxiv & Platzhalter & 2019 \
      midrule
      17 & arxiv & Platzhalter & 2019 \
      midrule
      18 & arxiv & Platzhalter & 2019 \
      midrule
      19 & arxiv & Platzhalter & 2019 \
      midrule
      20 & arxiv & Platzhalter & 2019 \
      midrule
      21 & arxiv & Platzhalter & 2019 \
      midrule
      22 & arxiv & Platzhalter & 2019 \
      midrule
      23 & arxiv & Platzhalter & 2019 \
      midrule
      24 & arxiv & Platzhalter & 2019 \
      midrule
      25 & arxiv & Platzhalter & 2019 \
      midrule
      26 & arxiv & Platzhalter & 2019 \
      midrule
      27 & arxiv & Platzhalter & 2019 \
      midrule
      28 & arxiv & Platzhalter & 2019 \
      midrule
      29 & arxiv & Platzhalter & 2019 \
      midrule
      30 & arxiv & Platzhalter & 2019 \
      midrule
      31 & arxiv & Platzhalter & 2019 \
      midrule
      32 & arxiv & Platzhalter & 2019 \
      midrule
      33 & arxiv & Platzhalter & 2019 \
      midrule
      34 & arxiv & Platzhalter & 2019 \
      midrule
      35 & arxiv & Platzhalter & 2019 \
      bottomrule
      end{longtable}
      label{tab:addlabel}


      end{document}







      tables color





      share












      share










      share



      share










      asked 3 mins ago









      slandoltslandolt

      485




      485






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "85"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f481005%2ftable-alternating-rowcolours-banding%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f481005%2ftable-alternating-rowcolours-banding%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Can't compile dgruyter and caption packagesLaTeX templates/packages for writing a patent specificationLatex...

          Schneeberg (Smreczany) Bibliografia | Menu...

          Hans Bellmer Spis treści Życiorys | Upamiętnienie | Przypisy | Bibliografia | Linki zewnętrzne |...