Table header color not working as i want

by L00n3y   Last Updated May 16, 2019 14:23 PM

I want the header of my table to be red but as you can see in the example it is red but also it seems there is a white extra column left to it. I can not seem to figure out why it is there. And how to remove it and get it fully red.

Below example table: example table

Below the code:

\documentclass[11pt, a4paper]{article}
\usepackage[a4paper,top=2cm,hmargin=2cm,bottom=3cm,]{geometry}
\usepackage{xcolor,colortbl}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{tikzpagenodes}
\usepackage{fancyhdr}
\usepackage{xcolor}
\usepackage{colortbl}
\usepackage[utf8]{inputenc}
\usepackage{titletoc}
\usepackage[T1]{fontenc}
\usepackage{sectsty}
\usepackage{float}
\usepackage{atbegshi}
\usepackage{fontspec}
\usepackage{graphicx}
\usepackage{tabu}
\begin{document}
    \noindent\begin{tabular*}{\columnwidth}{@{\extracolsep{\fill}} |l|l|l|l|l|l|l|}
    \hline
    \rowcolor[RGB]{227,24,24}\color{white}\large\bfseries Nr &\color{white}\large\bfseries IP & \color{white}\large\bfseries TL1 & \color{white}\large\bfseries TL2 & \color{white}\large\bfseries TL3 & \color{white}\large\bfseries TL4 & \color{white}\large\bfseries TL5 \\\hline 
    1. & 1.1.1.1 & 5 & 0 & 1 & 0 & 0\\ \hline
    2. & 1.2.3.4 & 5 & 0 & 0 & 0 & 0\\ \hline
    3. & 5.5.5.5 & 2 & 1 & 1 & 1 & 1\\ \hline
    4. & 95.231.766.33 & 1 & 0 & 0 & 0 & 0\\ \hline
    5. & 115.231.796.313 & 1 & 0 & 0 & 0 & 0\\ \hline
    6. & 115.231.776.313 & 1 & 0 & 0 & 0 & 0\\ \hline
    7. & 715.231.76.313 & 1 & 0 & 0 & 0 & 0\\ \hline
    8. & 415.231.76.313 & 1 & 0 & 0 & 0 & 0\\ \hline
    9. & 315.231.76.313 & 1 & 0 & 0 & 0 & 0\\ \hline
    10. & 215.231.76.313 & 1 & 0 & 0 & 0 & 0\\ \hline
    11. & 115.231.76.33 & 0 & 0 & 3 & 0 & 0\\ \hline
    12. & 95.271.76.33 & 0 & 0 & 2 & 0 & 0\\ \hline
    13. & 95.231.786.33 & 0 & 0 & 1 & 0 & 0\\ \hline
    14. & 95.231.756.33 & 0 & 0 & 1 & 0 & 0\\ \hline
    15. & 95.231.746.33 & 0 & 0 & 1 & 0 & 0\\ \hline
    16. & 95.231.736.33 & 0 & 0 & 1 & 0 & 0\\ \hline
    17. & 95.231.726.33 & 0 & 0 & 1 & 0 & 0\\ \hline
    18. & 95.231.716.33 & 0 & 0 & 1 & 0 & 0\\ \hline
    \end{tabular*}
\end{document}
Tags : tables colortbl


Answers 1


tabular* inserts space between the columns, and that is what you are seeing with the white gaps. Forcing the columns apart just make the table harder to read so simplest is to use a normal tabular

David Carlisle
David Carlisle
May 16, 2019 14:08 PM

Related Questions


Updated March 21, 2017 17:23 PM

Updated June 02, 2017 22:23 PM

Updated April 17, 2019 05:23 AM

Updated June 13, 2017 07:23 AM