How to fix my table, centering of columns












4















I've been trying to produce a table in which the first two columns has rows merged, the next three columns has columns merged, with three sub-columns, within the same height as the merged rows of cols 1 and 2, with a final column that has rows merged like cols 1 and 2-viz.Table Currently



I am using pdflatex, the tabularx package, booktabs package and array package. My relevant code is:



documentclass[12pt]{article}
usepackage{multirow}
usepackage{tabularx}
usepackage{booktabs}
begin{document}
begin{table}[h]
caption{Spectral channel characteristics of SEVIRI in terms of central, minimum and maximum wavelength of the channels and the main application areas of each channel.}
begin{tabularx}{textwidth}{l l c c c l}
toprule
multirow{3}{3.5em}{Channel No.} & multirow{3}{3.5em}{Spectral Band ($mu$m)} & multicolumn{3}{c}{Characteristics of} & multirow{3}{10em}{Main observational application} \
{} & {} & multicolumn{3}{c}{Spectral Band ($mu$m)} & {} \
cmidrule(lr){3-5}
{} & {} & $lambda_{mathrm{cen}}$ & $lambda_{mathrm{min}}$ & $lambda_{mathrm{max}}$ & {}\
midrule
1 & VIS0.6 & 0.635 & 0.56 & 0.71 & Surface, clouds, wind fields \
2 & VIS0.8 & 0.81 & 0.74 & 0.88 & Surface, clouds, wind fields \
3 & NIR1.6 & 1.64 & 1.50 & 1.78 & Surface, cloud phase \
4 & IR3.9 & 3.90 & 3.48 & 4.36 & Surface, clouds, wind fields \
5 & WV6.2 & 6.25 & 5.35 & 7.15 & Water vapor, high level clouds, atmospheric instability \
6 & WV7.3 & 7.35 & 6.85 & 7.85 & Water vapor, atmospheric instability \
7 & IR8.7 & 8.70 & 8.30 & 9.1 & Surface, clouds, atmospheric instability \
8 & IR9.7 & 9.66 & 9.38 & 9.94 & Ozone \
9 & IR10.8 & 10.80 & 9.80 & 11.80 & Surface, clouds, wind fields, atmospheric instability \
10 & IR12.0 & 12.00 & 11.00 & 13.00 & Surface, clouds, atmospheric instability \
11 & IR13.4 & 13.40 & 12.40 & 14.40 & Cirrus cloud height, atmospheric instability \
12 & HRV & multicolumn{3}{c}{Broadband (about 0.4--1.1 $mu$m)} & Surface, clouds \
bottomrule
end{tabularx}
end{table}
end{document}


I would like the lambda-containing columns to be evenly distributed. I tried to add sizing to the c c c columns, but then I get the illegal pream-token error when I run:



[1{c:/texlive/2018/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
! Package array Error: Illegal pream-token (2em): `c' used.

See the array package documentation for explanation.
Type H <return> for immediate help.
...

l.104 end{tabularx}


Any ideas?










share|improve this question




















  • 1





    Why are you using tabularx with no X columns? That goes against the idea to having tabularx in the first place. Plus you should probably learn to use siunitx for better unit handling.

    – daleif
    yesterday











  • BTW: I get no errors from your MWE using a full up to date TeXLive 2018.

    – daleif
    yesterday
















4















I've been trying to produce a table in which the first two columns has rows merged, the next three columns has columns merged, with three sub-columns, within the same height as the merged rows of cols 1 and 2, with a final column that has rows merged like cols 1 and 2-viz.Table Currently



I am using pdflatex, the tabularx package, booktabs package and array package. My relevant code is:



documentclass[12pt]{article}
usepackage{multirow}
usepackage{tabularx}
usepackage{booktabs}
begin{document}
begin{table}[h]
caption{Spectral channel characteristics of SEVIRI in terms of central, minimum and maximum wavelength of the channels and the main application areas of each channel.}
begin{tabularx}{textwidth}{l l c c c l}
toprule
multirow{3}{3.5em}{Channel No.} & multirow{3}{3.5em}{Spectral Band ($mu$m)} & multicolumn{3}{c}{Characteristics of} & multirow{3}{10em}{Main observational application} \
{} & {} & multicolumn{3}{c}{Spectral Band ($mu$m)} & {} \
cmidrule(lr){3-5}
{} & {} & $lambda_{mathrm{cen}}$ & $lambda_{mathrm{min}}$ & $lambda_{mathrm{max}}$ & {}\
midrule
1 & VIS0.6 & 0.635 & 0.56 & 0.71 & Surface, clouds, wind fields \
2 & VIS0.8 & 0.81 & 0.74 & 0.88 & Surface, clouds, wind fields \
3 & NIR1.6 & 1.64 & 1.50 & 1.78 & Surface, cloud phase \
4 & IR3.9 & 3.90 & 3.48 & 4.36 & Surface, clouds, wind fields \
5 & WV6.2 & 6.25 & 5.35 & 7.15 & Water vapor, high level clouds, atmospheric instability \
6 & WV7.3 & 7.35 & 6.85 & 7.85 & Water vapor, atmospheric instability \
7 & IR8.7 & 8.70 & 8.30 & 9.1 & Surface, clouds, atmospheric instability \
8 & IR9.7 & 9.66 & 9.38 & 9.94 & Ozone \
9 & IR10.8 & 10.80 & 9.80 & 11.80 & Surface, clouds, wind fields, atmospheric instability \
10 & IR12.0 & 12.00 & 11.00 & 13.00 & Surface, clouds, atmospheric instability \
11 & IR13.4 & 13.40 & 12.40 & 14.40 & Cirrus cloud height, atmospheric instability \
12 & HRV & multicolumn{3}{c}{Broadband (about 0.4--1.1 $mu$m)} & Surface, clouds \
bottomrule
end{tabularx}
end{table}
end{document}


I would like the lambda-containing columns to be evenly distributed. I tried to add sizing to the c c c columns, but then I get the illegal pream-token error when I run:



[1{c:/texlive/2018/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
! Package array Error: Illegal pream-token (2em): `c' used.

See the array package documentation for explanation.
Type H <return> for immediate help.
...

l.104 end{tabularx}


Any ideas?










share|improve this question




















  • 1





    Why are you using tabularx with no X columns? That goes against the idea to having tabularx in the first place. Plus you should probably learn to use siunitx for better unit handling.

    – daleif
    yesterday











  • BTW: I get no errors from your MWE using a full up to date TeXLive 2018.

    – daleif
    yesterday














4












4








4


0






I've been trying to produce a table in which the first two columns has rows merged, the next three columns has columns merged, with three sub-columns, within the same height as the merged rows of cols 1 and 2, with a final column that has rows merged like cols 1 and 2-viz.Table Currently



I am using pdflatex, the tabularx package, booktabs package and array package. My relevant code is:



documentclass[12pt]{article}
usepackage{multirow}
usepackage{tabularx}
usepackage{booktabs}
begin{document}
begin{table}[h]
caption{Spectral channel characteristics of SEVIRI in terms of central, minimum and maximum wavelength of the channels and the main application areas of each channel.}
begin{tabularx}{textwidth}{l l c c c l}
toprule
multirow{3}{3.5em}{Channel No.} & multirow{3}{3.5em}{Spectral Band ($mu$m)} & multicolumn{3}{c}{Characteristics of} & multirow{3}{10em}{Main observational application} \
{} & {} & multicolumn{3}{c}{Spectral Band ($mu$m)} & {} \
cmidrule(lr){3-5}
{} & {} & $lambda_{mathrm{cen}}$ & $lambda_{mathrm{min}}$ & $lambda_{mathrm{max}}$ & {}\
midrule
1 & VIS0.6 & 0.635 & 0.56 & 0.71 & Surface, clouds, wind fields \
2 & VIS0.8 & 0.81 & 0.74 & 0.88 & Surface, clouds, wind fields \
3 & NIR1.6 & 1.64 & 1.50 & 1.78 & Surface, cloud phase \
4 & IR3.9 & 3.90 & 3.48 & 4.36 & Surface, clouds, wind fields \
5 & WV6.2 & 6.25 & 5.35 & 7.15 & Water vapor, high level clouds, atmospheric instability \
6 & WV7.3 & 7.35 & 6.85 & 7.85 & Water vapor, atmospheric instability \
7 & IR8.7 & 8.70 & 8.30 & 9.1 & Surface, clouds, atmospheric instability \
8 & IR9.7 & 9.66 & 9.38 & 9.94 & Ozone \
9 & IR10.8 & 10.80 & 9.80 & 11.80 & Surface, clouds, wind fields, atmospheric instability \
10 & IR12.0 & 12.00 & 11.00 & 13.00 & Surface, clouds, atmospheric instability \
11 & IR13.4 & 13.40 & 12.40 & 14.40 & Cirrus cloud height, atmospheric instability \
12 & HRV & multicolumn{3}{c}{Broadband (about 0.4--1.1 $mu$m)} & Surface, clouds \
bottomrule
end{tabularx}
end{table}
end{document}


I would like the lambda-containing columns to be evenly distributed. I tried to add sizing to the c c c columns, but then I get the illegal pream-token error when I run:



[1{c:/texlive/2018/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
! Package array Error: Illegal pream-token (2em): `c' used.

See the array package documentation for explanation.
Type H <return> for immediate help.
...

l.104 end{tabularx}


Any ideas?










share|improve this question
















I've been trying to produce a table in which the first two columns has rows merged, the next three columns has columns merged, with three sub-columns, within the same height as the merged rows of cols 1 and 2, with a final column that has rows merged like cols 1 and 2-viz.Table Currently



I am using pdflatex, the tabularx package, booktabs package and array package. My relevant code is:



documentclass[12pt]{article}
usepackage{multirow}
usepackage{tabularx}
usepackage{booktabs}
begin{document}
begin{table}[h]
caption{Spectral channel characteristics of SEVIRI in terms of central, minimum and maximum wavelength of the channels and the main application areas of each channel.}
begin{tabularx}{textwidth}{l l c c c l}
toprule
multirow{3}{3.5em}{Channel No.} & multirow{3}{3.5em}{Spectral Band ($mu$m)} & multicolumn{3}{c}{Characteristics of} & multirow{3}{10em}{Main observational application} \
{} & {} & multicolumn{3}{c}{Spectral Band ($mu$m)} & {} \
cmidrule(lr){3-5}
{} & {} & $lambda_{mathrm{cen}}$ & $lambda_{mathrm{min}}$ & $lambda_{mathrm{max}}$ & {}\
midrule
1 & VIS0.6 & 0.635 & 0.56 & 0.71 & Surface, clouds, wind fields \
2 & VIS0.8 & 0.81 & 0.74 & 0.88 & Surface, clouds, wind fields \
3 & NIR1.6 & 1.64 & 1.50 & 1.78 & Surface, cloud phase \
4 & IR3.9 & 3.90 & 3.48 & 4.36 & Surface, clouds, wind fields \
5 & WV6.2 & 6.25 & 5.35 & 7.15 & Water vapor, high level clouds, atmospheric instability \
6 & WV7.3 & 7.35 & 6.85 & 7.85 & Water vapor, atmospheric instability \
7 & IR8.7 & 8.70 & 8.30 & 9.1 & Surface, clouds, atmospheric instability \
8 & IR9.7 & 9.66 & 9.38 & 9.94 & Ozone \
9 & IR10.8 & 10.80 & 9.80 & 11.80 & Surface, clouds, wind fields, atmospheric instability \
10 & IR12.0 & 12.00 & 11.00 & 13.00 & Surface, clouds, atmospheric instability \
11 & IR13.4 & 13.40 & 12.40 & 14.40 & Cirrus cloud height, atmospheric instability \
12 & HRV & multicolumn{3}{c}{Broadband (about 0.4--1.1 $mu$m)} & Surface, clouds \
bottomrule
end{tabularx}
end{table}
end{document}


I would like the lambda-containing columns to be evenly distributed. I tried to add sizing to the c c c columns, but then I get the illegal pream-token error when I run:



[1{c:/texlive/2018/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
! Package array Error: Illegal pream-token (2em): `c' used.

See the array package documentation for explanation.
Type H <return> for immediate help.
...

l.104 end{tabularx}


Any ideas?







tables tabularx






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday









Christoph Frings

923211




923211










asked yesterday









AdrianAdrian

76116




76116








  • 1





    Why are you using tabularx with no X columns? That goes against the idea to having tabularx in the first place. Plus you should probably learn to use siunitx for better unit handling.

    – daleif
    yesterday











  • BTW: I get no errors from your MWE using a full up to date TeXLive 2018.

    – daleif
    yesterday














  • 1





    Why are you using tabularx with no X columns? That goes against the idea to having tabularx in the first place. Plus you should probably learn to use siunitx for better unit handling.

    – daleif
    yesterday











  • BTW: I get no errors from your MWE using a full up to date TeXLive 2018.

    – daleif
    yesterday








1




1





Why are you using tabularx with no X columns? That goes against the idea to having tabularx in the first place. Plus you should probably learn to use siunitx for better unit handling.

– daleif
yesterday





Why are you using tabularx with no X columns? That goes against the idea to having tabularx in the first place. Plus you should probably learn to use siunitx for better unit handling.

– daleif
yesterday













BTW: I get no errors from your MWE using a full up to date TeXLive 2018.

– daleif
yesterday





BTW: I get no errors from your MWE using a full up to date TeXLive 2018.

– daleif
yesterday










4 Answers
4






active

oldest

votes


















6














Here's my proposal:



documentclass[12pt]{article}
usepackage{tabularx}
usepackage{booktabs}
usepackage{siunitx} % also loads xparse

sisetup{range-phrase = --}

NewDocumentCommand{splitcell}{mo}{%
IfNoValueTF{#2}{%
begin{tabular}[t]{@{}c@{}}#1end{tabular}%
}{%
vphantom{begin{tabular}[t]{@{}c@{}}#1end{tabular}}%
smash{begin{tabular}[t]{@{}c@{}}#1\#2end{tabular}}%
}%
}

begin{document}

begin{table}[htp]

caption{Spectral channel characteristics of SEVIRI in terms
of central, minimum and maximum wavelength of the channels
and the main application areas of each channel.}

medskip

begin{tabularx}{textwidth}{
@{}
S[table-format=2.0]
c
S[table-format=2.3]
S[table-format=2.2]
S[table-format=2.2]
>{raggedrightarraybackslash}X
@{}
}
toprule

{splitcell{Channel \ No.}} &
splitcell{Spectral \ Band}[si{micrometer}] &
multicolumn{3}{c}{
splitcell{Characteristics of \ Spectral Band (si{micrometer})}%
} &
Main observational application \
cmidrule(lr){3-5}
{} & {} & {$lambda_{mathrm{cen}}$} &
{$lambda_{mathrm{min}}$} &
{$lambda_{mathrm{max}}$} & \
midrule
1 & VIS0.6 & 0.635 & 0.56 & 0.71 & Surface, clouds, wind fields \
2 & VIS0.8 & 0.81 & 0.74 & 0.88 & Surface, clouds, wind fields \
3 & NIR1.6 & 1.64 & 1.50 & 1.78 & Surface, cloud phase \
4 & IR3.9 & 3.90 & 3.48 & 4.36 & Surface, clouds, wind fields \
5 & WV6.2 & 6.25 & 5.35 & 7.15 & Water vapor, high level clouds, atmospheric instability \
6 & WV7.3 & 7.35 & 6.85 & 7.85 & Water vapor, atmospheric instability \
7 & IR8.7 & 8.70 & 8.30 & 9.1 & Surface, clouds, atmospheric instability \
8 & IR9.7 & 9.66 & 9.38 & 9.94 & Ozone \
9 & IR10.8 & 10.80 & 9.80 & 11.80 & Surface, clouds, wind fields, atmospheric instability \
10 & IR12.0 & 12.00 & 11.00 & 13.00 & Surface, clouds, atmospheric instability \
11 & IR13.4 & 13.40 & 12.40 & 14.40 & Cirrus cloud height, atmospheric instability \
12 & HRV & multicolumn{3}{c}{%
splitcell{Broadband \ (about SIrange{0.4}{1.1}{micrometer})}} &
Surface, clouds \
bottomrule
end{tabularx}

end{table}

end{document}


enter image description here






share|improve this answer































    4














    I'd probably start with. That long line in no 12, will never look any good, so best to rewrite it.



    documentclass[12pt]{article}
    usepackage{multirow}
    usepackage{tabularx}
    usepackage{booktabs}
    usepackage[tableposition=top]{caption}
    usepackage{siunitx}
    begin{document}
    begin{table}[h]
    caption{Spectral channel characteristics of SEVIRI in terms of
    central, minimum and maximum wavelength of the channels and the
    main application areas of each channel.}
    begin{tabularx}{textwidth}{
    l
    l
    S[table-format=2.3]
    S[table-format=2.2]
    S[table-format=2.2]
    >{raggedrightarraybackslash}X
    }
    toprule
    multirow{3}{3.5em}{Channel No.}
    &
    multirow{3}{3.5em}{centering Spectral Band (si{micrometer})}
    &
    multicolumn{3}{c}{Characteristics of}
    &
    multirow{3}{10em}{Main observational application}
    \
    {} & {} & multicolumn{3}{c}{Spectral Band (si{micrometer})} & {}
    \
    cmidrule(lr){3-5}
    {} & {} & {$lambda_{mathrm{cen}}$} & {$lambda_{mathrm{min}}$} &
    {$lambda_{mathrm{max}}$} & {}
    \
    midrule
    1 & VIS0.6 & 0.635 & 0.56 & 0.71 & Surface, clouds, wind fields
    \
    2 & VIS0.8 & 0.81 & 0.74 & 0.88 & Surface, clouds, wind fields
    \
    3 & NIR1.6 & 1.64 & 1.50 & 1.78 & Surface, cloud phase
    \
    4 & IR3.9 & 3.90 & 3.48 & 4.36 & Surface, clouds, wind fields
    \
    5 & WV6.2 & 6.25 & 5.35 & 7.15 & Water vapor, high level clouds,
    atmospheric instability
    \
    6 & WV7.3 & 7.35 & 6.85 & 7.85 & Water vapor, atmospheric instability
    \
    7 & IR8.7 & 8.70 & 8.30 & 9.1 & Surface, clouds, atmospheric
    instability
    \
    8 & IR9.7 & 9.66 & 9.38 & 9.94 & Ozone
    \
    9 & IR10.8 & 10.80 & 9.80 & 11.80 & Surface, clouds, wind fields,
    atmospheric instability
    \
    10 & IR12.0 & 12.00 & 11.00 & 13.00 & Surface, clouds, atmospheric
    instability
    \
    11 & IR13.4 & 13.40 & 12.40 & 14.40 & Cirrus cloud height, atmospheric instability \
    12 & HRV & multicolumn{3}{c}{Broadband*} & Surface, clouds \
    bottomrule
    addlinespace
    multicolumn{4}{l}{* about SIrange{0.4}{1.1}{micrometer}}
    end{tabularx}
    end{table}
    end{document}





    share|improve this answer































      4














      a small variation of @daleif answer with considering coloring of rows from your answer. i also took a liberty and change column names:



      enter image description here



      documentclass[12pt]{article}
      usepackage[table]{xcolor}
      usepackage{booktabs, multirow, tabularx}
      newcommandmrc[1]{linespread{0.8}selectfontbegin{tabular}[t]{@{} c @{}}#1end{tabular}}
      usepackage[skip=1ex]{caption}
      usepackage[range-phrase = --]{siunitx}

      %---------------- show page layout. don't use in a real document!
      usepackage{showframe}
      renewcommandShowFrameLinethickness{0.15pt}
      renewcommand*ShowFrameColor{color{red}}

      begin{document}
      begin{table}[h]
      caption{Spectral channel characteristics of SEVIRI in terms of central, minimum and maximum wavelength of the channels and the main application areas of each channel.}
      label{tab:channels}
      renewcommandarraystretch{1.2}
      setlengthtabcolsep{4pt}
      rowcolors{3}{white}{gray!15}
      begin{tabularx}{textwidth}{
      p{2em}
      p{3em}
      S[table-format=2.3]
      *{2}{S[table-format=1.3]}
      >{raggedrightarraybackslash}X
      }
      toprule
      &
      & multicolumn{3}{c}{mrc{Spectral band\ characteristics (si{micrometer})}}
      & \
      cmidrule(lr){3-5}
      multirow[b]{-3.3}{=}{Ch. No.}
      & multirow[b]{-3.3}{=}{Band name}
      & {$lambda_{mathrm{cen}}$}
      & {$lambda_{min}$}
      & {$lambda_{max}$}
      & multirow[b]{-3}{linewidth}{Main observational application} \
      hline
      1 & VIS0.6 & 0.635 & 0.56 & 0.71 & Surface, clouds, wind fields \
      2 & VIS0.8 & 0.81 & 0.74 & 0.88 & Surface, clouds, wind fields \
      3 & NIR1.6 & 1.64 & 1.50 & 1.78 & Surface, cloud phase \
      4 & IR3.9 & 3.90 & 3.48 & 4.36 & Surface, clouds, wind fields \
      5 & WV6.2 & 6.25 & 5.35 & 7.15 & Water vapor, high level clouds, atmospheric instability \
      6 & WV7.3 & 7.35 & 6.85 & 7.85 & Water vapor, atmospheric instability \
      7 & IR8.7 & 8.70 & 8.30 & 9.1 & Surface, clouds, atmospheric instability \
      8 & IR9.7 & 9.66 & 9.38 & 9.94 & Ozone \
      9 & IR10.8 & 10.80 & 9.80 & 11.80 & Surface, clouds, wind fields, atmospheric instability \
      10 & IR12.0 & 12.00 & 11.00 & 13.00 & Surface, clouds, atmospheric instability \
      11 & IR13.4 & 13.40 & 12.40 & 14.40 & Cirrus cloud height, atmospheric instability \
      12 & HRV & multicolumn{3}{c}{mrc{Broadband\(about SIrange{0.4}{1.1}{micrometer})}}
      & Surface, clouds \
      bottomrule
      end{tabularx}





      share|improve this answer

































        2














        Thanks for all the responses! So, I've been playing with tabularx and saw someone define a type of column in the preamble in a previous posting:



        newcolumntype{Y}{>{centeringarraybackslash}X}


        So now, when I specify the middle three columns as Y and tweaking my column size a bit (also, l, c, and r don't accept sizing, that's why I was getting the error, I switched to p, m and b of the array package):



        begin{tabularx}{textwidth}{p{3.5em} p{3.5em} Y Y Y p{10em}}


        I get very close to what I was looking for:



        New Table



        (Sorry about the dark rows, I am also playing with rowcolors).



        Thanks again for the input!






        share|improve this answer


























        • Thanks for the tip about the SI units too, I will keep them in mind for the future.

          – Adrian
          yesterday






        • 1





          You said "saw someone ...". I think you should add his/her user-name here (for the credit).

          – JouleV
          yesterday






        • 1





          Ah yes, sure, that would be Mico. Thanks Mico!

          – Adrian
          yesterday











        • @Adrian - Thanks for the shout-out. :-)

          – Mico
          yesterday











        • So, just to update, I also did some raggedright modification of the last p column to get rid of the spaces due to justification. The relevant command is begin{tabularx}{textwidth}{p{3.5em} p{3.5em} Y Y Y >{raggedrightarraybackslash}p{10em}}, as proposed by Saravanan.

          – Adrian
          yesterday











        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%2f478039%2fhow-to-fix-my-table-centering-of-columns%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        4 Answers
        4






        active

        oldest

        votes








        4 Answers
        4






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        6














        Here's my proposal:



        documentclass[12pt]{article}
        usepackage{tabularx}
        usepackage{booktabs}
        usepackage{siunitx} % also loads xparse

        sisetup{range-phrase = --}

        NewDocumentCommand{splitcell}{mo}{%
        IfNoValueTF{#2}{%
        begin{tabular}[t]{@{}c@{}}#1end{tabular}%
        }{%
        vphantom{begin{tabular}[t]{@{}c@{}}#1end{tabular}}%
        smash{begin{tabular}[t]{@{}c@{}}#1\#2end{tabular}}%
        }%
        }

        begin{document}

        begin{table}[htp]

        caption{Spectral channel characteristics of SEVIRI in terms
        of central, minimum and maximum wavelength of the channels
        and the main application areas of each channel.}

        medskip

        begin{tabularx}{textwidth}{
        @{}
        S[table-format=2.0]
        c
        S[table-format=2.3]
        S[table-format=2.2]
        S[table-format=2.2]
        >{raggedrightarraybackslash}X
        @{}
        }
        toprule

        {splitcell{Channel \ No.}} &
        splitcell{Spectral \ Band}[si{micrometer}] &
        multicolumn{3}{c}{
        splitcell{Characteristics of \ Spectral Band (si{micrometer})}%
        } &
        Main observational application \
        cmidrule(lr){3-5}
        {} & {} & {$lambda_{mathrm{cen}}$} &
        {$lambda_{mathrm{min}}$} &
        {$lambda_{mathrm{max}}$} & \
        midrule
        1 & VIS0.6 & 0.635 & 0.56 & 0.71 & Surface, clouds, wind fields \
        2 & VIS0.8 & 0.81 & 0.74 & 0.88 & Surface, clouds, wind fields \
        3 & NIR1.6 & 1.64 & 1.50 & 1.78 & Surface, cloud phase \
        4 & IR3.9 & 3.90 & 3.48 & 4.36 & Surface, clouds, wind fields \
        5 & WV6.2 & 6.25 & 5.35 & 7.15 & Water vapor, high level clouds, atmospheric instability \
        6 & WV7.3 & 7.35 & 6.85 & 7.85 & Water vapor, atmospheric instability \
        7 & IR8.7 & 8.70 & 8.30 & 9.1 & Surface, clouds, atmospheric instability \
        8 & IR9.7 & 9.66 & 9.38 & 9.94 & Ozone \
        9 & IR10.8 & 10.80 & 9.80 & 11.80 & Surface, clouds, wind fields, atmospheric instability \
        10 & IR12.0 & 12.00 & 11.00 & 13.00 & Surface, clouds, atmospheric instability \
        11 & IR13.4 & 13.40 & 12.40 & 14.40 & Cirrus cloud height, atmospheric instability \
        12 & HRV & multicolumn{3}{c}{%
        splitcell{Broadband \ (about SIrange{0.4}{1.1}{micrometer})}} &
        Surface, clouds \
        bottomrule
        end{tabularx}

        end{table}

        end{document}


        enter image description here






        share|improve this answer




























          6














          Here's my proposal:



          documentclass[12pt]{article}
          usepackage{tabularx}
          usepackage{booktabs}
          usepackage{siunitx} % also loads xparse

          sisetup{range-phrase = --}

          NewDocumentCommand{splitcell}{mo}{%
          IfNoValueTF{#2}{%
          begin{tabular}[t]{@{}c@{}}#1end{tabular}%
          }{%
          vphantom{begin{tabular}[t]{@{}c@{}}#1end{tabular}}%
          smash{begin{tabular}[t]{@{}c@{}}#1\#2end{tabular}}%
          }%
          }

          begin{document}

          begin{table}[htp]

          caption{Spectral channel characteristics of SEVIRI in terms
          of central, minimum and maximum wavelength of the channels
          and the main application areas of each channel.}

          medskip

          begin{tabularx}{textwidth}{
          @{}
          S[table-format=2.0]
          c
          S[table-format=2.3]
          S[table-format=2.2]
          S[table-format=2.2]
          >{raggedrightarraybackslash}X
          @{}
          }
          toprule

          {splitcell{Channel \ No.}} &
          splitcell{Spectral \ Band}[si{micrometer}] &
          multicolumn{3}{c}{
          splitcell{Characteristics of \ Spectral Band (si{micrometer})}%
          } &
          Main observational application \
          cmidrule(lr){3-5}
          {} & {} & {$lambda_{mathrm{cen}}$} &
          {$lambda_{mathrm{min}}$} &
          {$lambda_{mathrm{max}}$} & \
          midrule
          1 & VIS0.6 & 0.635 & 0.56 & 0.71 & Surface, clouds, wind fields \
          2 & VIS0.8 & 0.81 & 0.74 & 0.88 & Surface, clouds, wind fields \
          3 & NIR1.6 & 1.64 & 1.50 & 1.78 & Surface, cloud phase \
          4 & IR3.9 & 3.90 & 3.48 & 4.36 & Surface, clouds, wind fields \
          5 & WV6.2 & 6.25 & 5.35 & 7.15 & Water vapor, high level clouds, atmospheric instability \
          6 & WV7.3 & 7.35 & 6.85 & 7.85 & Water vapor, atmospheric instability \
          7 & IR8.7 & 8.70 & 8.30 & 9.1 & Surface, clouds, atmospheric instability \
          8 & IR9.7 & 9.66 & 9.38 & 9.94 & Ozone \
          9 & IR10.8 & 10.80 & 9.80 & 11.80 & Surface, clouds, wind fields, atmospheric instability \
          10 & IR12.0 & 12.00 & 11.00 & 13.00 & Surface, clouds, atmospheric instability \
          11 & IR13.4 & 13.40 & 12.40 & 14.40 & Cirrus cloud height, atmospheric instability \
          12 & HRV & multicolumn{3}{c}{%
          splitcell{Broadband \ (about SIrange{0.4}{1.1}{micrometer})}} &
          Surface, clouds \
          bottomrule
          end{tabularx}

          end{table}

          end{document}


          enter image description here






          share|improve this answer


























            6












            6








            6







            Here's my proposal:



            documentclass[12pt]{article}
            usepackage{tabularx}
            usepackage{booktabs}
            usepackage{siunitx} % also loads xparse

            sisetup{range-phrase = --}

            NewDocumentCommand{splitcell}{mo}{%
            IfNoValueTF{#2}{%
            begin{tabular}[t]{@{}c@{}}#1end{tabular}%
            }{%
            vphantom{begin{tabular}[t]{@{}c@{}}#1end{tabular}}%
            smash{begin{tabular}[t]{@{}c@{}}#1\#2end{tabular}}%
            }%
            }

            begin{document}

            begin{table}[htp]

            caption{Spectral channel characteristics of SEVIRI in terms
            of central, minimum and maximum wavelength of the channels
            and the main application areas of each channel.}

            medskip

            begin{tabularx}{textwidth}{
            @{}
            S[table-format=2.0]
            c
            S[table-format=2.3]
            S[table-format=2.2]
            S[table-format=2.2]
            >{raggedrightarraybackslash}X
            @{}
            }
            toprule

            {splitcell{Channel \ No.}} &
            splitcell{Spectral \ Band}[si{micrometer}] &
            multicolumn{3}{c}{
            splitcell{Characteristics of \ Spectral Band (si{micrometer})}%
            } &
            Main observational application \
            cmidrule(lr){3-5}
            {} & {} & {$lambda_{mathrm{cen}}$} &
            {$lambda_{mathrm{min}}$} &
            {$lambda_{mathrm{max}}$} & \
            midrule
            1 & VIS0.6 & 0.635 & 0.56 & 0.71 & Surface, clouds, wind fields \
            2 & VIS0.8 & 0.81 & 0.74 & 0.88 & Surface, clouds, wind fields \
            3 & NIR1.6 & 1.64 & 1.50 & 1.78 & Surface, cloud phase \
            4 & IR3.9 & 3.90 & 3.48 & 4.36 & Surface, clouds, wind fields \
            5 & WV6.2 & 6.25 & 5.35 & 7.15 & Water vapor, high level clouds, atmospheric instability \
            6 & WV7.3 & 7.35 & 6.85 & 7.85 & Water vapor, atmospheric instability \
            7 & IR8.7 & 8.70 & 8.30 & 9.1 & Surface, clouds, atmospheric instability \
            8 & IR9.7 & 9.66 & 9.38 & 9.94 & Ozone \
            9 & IR10.8 & 10.80 & 9.80 & 11.80 & Surface, clouds, wind fields, atmospheric instability \
            10 & IR12.0 & 12.00 & 11.00 & 13.00 & Surface, clouds, atmospheric instability \
            11 & IR13.4 & 13.40 & 12.40 & 14.40 & Cirrus cloud height, atmospheric instability \
            12 & HRV & multicolumn{3}{c}{%
            splitcell{Broadband \ (about SIrange{0.4}{1.1}{micrometer})}} &
            Surface, clouds \
            bottomrule
            end{tabularx}

            end{table}

            end{document}


            enter image description here






            share|improve this answer













            Here's my proposal:



            documentclass[12pt]{article}
            usepackage{tabularx}
            usepackage{booktabs}
            usepackage{siunitx} % also loads xparse

            sisetup{range-phrase = --}

            NewDocumentCommand{splitcell}{mo}{%
            IfNoValueTF{#2}{%
            begin{tabular}[t]{@{}c@{}}#1end{tabular}%
            }{%
            vphantom{begin{tabular}[t]{@{}c@{}}#1end{tabular}}%
            smash{begin{tabular}[t]{@{}c@{}}#1\#2end{tabular}}%
            }%
            }

            begin{document}

            begin{table}[htp]

            caption{Spectral channel characteristics of SEVIRI in terms
            of central, minimum and maximum wavelength of the channels
            and the main application areas of each channel.}

            medskip

            begin{tabularx}{textwidth}{
            @{}
            S[table-format=2.0]
            c
            S[table-format=2.3]
            S[table-format=2.2]
            S[table-format=2.2]
            >{raggedrightarraybackslash}X
            @{}
            }
            toprule

            {splitcell{Channel \ No.}} &
            splitcell{Spectral \ Band}[si{micrometer}] &
            multicolumn{3}{c}{
            splitcell{Characteristics of \ Spectral Band (si{micrometer})}%
            } &
            Main observational application \
            cmidrule(lr){3-5}
            {} & {} & {$lambda_{mathrm{cen}}$} &
            {$lambda_{mathrm{min}}$} &
            {$lambda_{mathrm{max}}$} & \
            midrule
            1 & VIS0.6 & 0.635 & 0.56 & 0.71 & Surface, clouds, wind fields \
            2 & VIS0.8 & 0.81 & 0.74 & 0.88 & Surface, clouds, wind fields \
            3 & NIR1.6 & 1.64 & 1.50 & 1.78 & Surface, cloud phase \
            4 & IR3.9 & 3.90 & 3.48 & 4.36 & Surface, clouds, wind fields \
            5 & WV6.2 & 6.25 & 5.35 & 7.15 & Water vapor, high level clouds, atmospheric instability \
            6 & WV7.3 & 7.35 & 6.85 & 7.85 & Water vapor, atmospheric instability \
            7 & IR8.7 & 8.70 & 8.30 & 9.1 & Surface, clouds, atmospheric instability \
            8 & IR9.7 & 9.66 & 9.38 & 9.94 & Ozone \
            9 & IR10.8 & 10.80 & 9.80 & 11.80 & Surface, clouds, wind fields, atmospheric instability \
            10 & IR12.0 & 12.00 & 11.00 & 13.00 & Surface, clouds, atmospheric instability \
            11 & IR13.4 & 13.40 & 12.40 & 14.40 & Cirrus cloud height, atmospheric instability \
            12 & HRV & multicolumn{3}{c}{%
            splitcell{Broadband \ (about SIrange{0.4}{1.1}{micrometer})}} &
            Surface, clouds \
            bottomrule
            end{tabularx}

            end{table}

            end{document}


            enter image description here







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered yesterday









            egregegreg

            724k8819183223




            724k8819183223























                4














                I'd probably start with. That long line in no 12, will never look any good, so best to rewrite it.



                documentclass[12pt]{article}
                usepackage{multirow}
                usepackage{tabularx}
                usepackage{booktabs}
                usepackage[tableposition=top]{caption}
                usepackage{siunitx}
                begin{document}
                begin{table}[h]
                caption{Spectral channel characteristics of SEVIRI in terms of
                central, minimum and maximum wavelength of the channels and the
                main application areas of each channel.}
                begin{tabularx}{textwidth}{
                l
                l
                S[table-format=2.3]
                S[table-format=2.2]
                S[table-format=2.2]
                >{raggedrightarraybackslash}X
                }
                toprule
                multirow{3}{3.5em}{Channel No.}
                &
                multirow{3}{3.5em}{centering Spectral Band (si{micrometer})}
                &
                multicolumn{3}{c}{Characteristics of}
                &
                multirow{3}{10em}{Main observational application}
                \
                {} & {} & multicolumn{3}{c}{Spectral Band (si{micrometer})} & {}
                \
                cmidrule(lr){3-5}
                {} & {} & {$lambda_{mathrm{cen}}$} & {$lambda_{mathrm{min}}$} &
                {$lambda_{mathrm{max}}$} & {}
                \
                midrule
                1 & VIS0.6 & 0.635 & 0.56 & 0.71 & Surface, clouds, wind fields
                \
                2 & VIS0.8 & 0.81 & 0.74 & 0.88 & Surface, clouds, wind fields
                \
                3 & NIR1.6 & 1.64 & 1.50 & 1.78 & Surface, cloud phase
                \
                4 & IR3.9 & 3.90 & 3.48 & 4.36 & Surface, clouds, wind fields
                \
                5 & WV6.2 & 6.25 & 5.35 & 7.15 & Water vapor, high level clouds,
                atmospheric instability
                \
                6 & WV7.3 & 7.35 & 6.85 & 7.85 & Water vapor, atmospheric instability
                \
                7 & IR8.7 & 8.70 & 8.30 & 9.1 & Surface, clouds, atmospheric
                instability
                \
                8 & IR9.7 & 9.66 & 9.38 & 9.94 & Ozone
                \
                9 & IR10.8 & 10.80 & 9.80 & 11.80 & Surface, clouds, wind fields,
                atmospheric instability
                \
                10 & IR12.0 & 12.00 & 11.00 & 13.00 & Surface, clouds, atmospheric
                instability
                \
                11 & IR13.4 & 13.40 & 12.40 & 14.40 & Cirrus cloud height, atmospheric instability \
                12 & HRV & multicolumn{3}{c}{Broadband*} & Surface, clouds \
                bottomrule
                addlinespace
                multicolumn{4}{l}{* about SIrange{0.4}{1.1}{micrometer}}
                end{tabularx}
                end{table}
                end{document}





                share|improve this answer




























                  4














                  I'd probably start with. That long line in no 12, will never look any good, so best to rewrite it.



                  documentclass[12pt]{article}
                  usepackage{multirow}
                  usepackage{tabularx}
                  usepackage{booktabs}
                  usepackage[tableposition=top]{caption}
                  usepackage{siunitx}
                  begin{document}
                  begin{table}[h]
                  caption{Spectral channel characteristics of SEVIRI in terms of
                  central, minimum and maximum wavelength of the channels and the
                  main application areas of each channel.}
                  begin{tabularx}{textwidth}{
                  l
                  l
                  S[table-format=2.3]
                  S[table-format=2.2]
                  S[table-format=2.2]
                  >{raggedrightarraybackslash}X
                  }
                  toprule
                  multirow{3}{3.5em}{Channel No.}
                  &
                  multirow{3}{3.5em}{centering Spectral Band (si{micrometer})}
                  &
                  multicolumn{3}{c}{Characteristics of}
                  &
                  multirow{3}{10em}{Main observational application}
                  \
                  {} & {} & multicolumn{3}{c}{Spectral Band (si{micrometer})} & {}
                  \
                  cmidrule(lr){3-5}
                  {} & {} & {$lambda_{mathrm{cen}}$} & {$lambda_{mathrm{min}}$} &
                  {$lambda_{mathrm{max}}$} & {}
                  \
                  midrule
                  1 & VIS0.6 & 0.635 & 0.56 & 0.71 & Surface, clouds, wind fields
                  \
                  2 & VIS0.8 & 0.81 & 0.74 & 0.88 & Surface, clouds, wind fields
                  \
                  3 & NIR1.6 & 1.64 & 1.50 & 1.78 & Surface, cloud phase
                  \
                  4 & IR3.9 & 3.90 & 3.48 & 4.36 & Surface, clouds, wind fields
                  \
                  5 & WV6.2 & 6.25 & 5.35 & 7.15 & Water vapor, high level clouds,
                  atmospheric instability
                  \
                  6 & WV7.3 & 7.35 & 6.85 & 7.85 & Water vapor, atmospheric instability
                  \
                  7 & IR8.7 & 8.70 & 8.30 & 9.1 & Surface, clouds, atmospheric
                  instability
                  \
                  8 & IR9.7 & 9.66 & 9.38 & 9.94 & Ozone
                  \
                  9 & IR10.8 & 10.80 & 9.80 & 11.80 & Surface, clouds, wind fields,
                  atmospheric instability
                  \
                  10 & IR12.0 & 12.00 & 11.00 & 13.00 & Surface, clouds, atmospheric
                  instability
                  \
                  11 & IR13.4 & 13.40 & 12.40 & 14.40 & Cirrus cloud height, atmospheric instability \
                  12 & HRV & multicolumn{3}{c}{Broadband*} & Surface, clouds \
                  bottomrule
                  addlinespace
                  multicolumn{4}{l}{* about SIrange{0.4}{1.1}{micrometer}}
                  end{tabularx}
                  end{table}
                  end{document}





                  share|improve this answer


























                    4












                    4








                    4







                    I'd probably start with. That long line in no 12, will never look any good, so best to rewrite it.



                    documentclass[12pt]{article}
                    usepackage{multirow}
                    usepackage{tabularx}
                    usepackage{booktabs}
                    usepackage[tableposition=top]{caption}
                    usepackage{siunitx}
                    begin{document}
                    begin{table}[h]
                    caption{Spectral channel characteristics of SEVIRI in terms of
                    central, minimum and maximum wavelength of the channels and the
                    main application areas of each channel.}
                    begin{tabularx}{textwidth}{
                    l
                    l
                    S[table-format=2.3]
                    S[table-format=2.2]
                    S[table-format=2.2]
                    >{raggedrightarraybackslash}X
                    }
                    toprule
                    multirow{3}{3.5em}{Channel No.}
                    &
                    multirow{3}{3.5em}{centering Spectral Band (si{micrometer})}
                    &
                    multicolumn{3}{c}{Characteristics of}
                    &
                    multirow{3}{10em}{Main observational application}
                    \
                    {} & {} & multicolumn{3}{c}{Spectral Band (si{micrometer})} & {}
                    \
                    cmidrule(lr){3-5}
                    {} & {} & {$lambda_{mathrm{cen}}$} & {$lambda_{mathrm{min}}$} &
                    {$lambda_{mathrm{max}}$} & {}
                    \
                    midrule
                    1 & VIS0.6 & 0.635 & 0.56 & 0.71 & Surface, clouds, wind fields
                    \
                    2 & VIS0.8 & 0.81 & 0.74 & 0.88 & Surface, clouds, wind fields
                    \
                    3 & NIR1.6 & 1.64 & 1.50 & 1.78 & Surface, cloud phase
                    \
                    4 & IR3.9 & 3.90 & 3.48 & 4.36 & Surface, clouds, wind fields
                    \
                    5 & WV6.2 & 6.25 & 5.35 & 7.15 & Water vapor, high level clouds,
                    atmospheric instability
                    \
                    6 & WV7.3 & 7.35 & 6.85 & 7.85 & Water vapor, atmospheric instability
                    \
                    7 & IR8.7 & 8.70 & 8.30 & 9.1 & Surface, clouds, atmospheric
                    instability
                    \
                    8 & IR9.7 & 9.66 & 9.38 & 9.94 & Ozone
                    \
                    9 & IR10.8 & 10.80 & 9.80 & 11.80 & Surface, clouds, wind fields,
                    atmospheric instability
                    \
                    10 & IR12.0 & 12.00 & 11.00 & 13.00 & Surface, clouds, atmospheric
                    instability
                    \
                    11 & IR13.4 & 13.40 & 12.40 & 14.40 & Cirrus cloud height, atmospheric instability \
                    12 & HRV & multicolumn{3}{c}{Broadband*} & Surface, clouds \
                    bottomrule
                    addlinespace
                    multicolumn{4}{l}{* about SIrange{0.4}{1.1}{micrometer}}
                    end{tabularx}
                    end{table}
                    end{document}





                    share|improve this answer













                    I'd probably start with. That long line in no 12, will never look any good, so best to rewrite it.



                    documentclass[12pt]{article}
                    usepackage{multirow}
                    usepackage{tabularx}
                    usepackage{booktabs}
                    usepackage[tableposition=top]{caption}
                    usepackage{siunitx}
                    begin{document}
                    begin{table}[h]
                    caption{Spectral channel characteristics of SEVIRI in terms of
                    central, minimum and maximum wavelength of the channels and the
                    main application areas of each channel.}
                    begin{tabularx}{textwidth}{
                    l
                    l
                    S[table-format=2.3]
                    S[table-format=2.2]
                    S[table-format=2.2]
                    >{raggedrightarraybackslash}X
                    }
                    toprule
                    multirow{3}{3.5em}{Channel No.}
                    &
                    multirow{3}{3.5em}{centering Spectral Band (si{micrometer})}
                    &
                    multicolumn{3}{c}{Characteristics of}
                    &
                    multirow{3}{10em}{Main observational application}
                    \
                    {} & {} & multicolumn{3}{c}{Spectral Band (si{micrometer})} & {}
                    \
                    cmidrule(lr){3-5}
                    {} & {} & {$lambda_{mathrm{cen}}$} & {$lambda_{mathrm{min}}$} &
                    {$lambda_{mathrm{max}}$} & {}
                    \
                    midrule
                    1 & VIS0.6 & 0.635 & 0.56 & 0.71 & Surface, clouds, wind fields
                    \
                    2 & VIS0.8 & 0.81 & 0.74 & 0.88 & Surface, clouds, wind fields
                    \
                    3 & NIR1.6 & 1.64 & 1.50 & 1.78 & Surface, cloud phase
                    \
                    4 & IR3.9 & 3.90 & 3.48 & 4.36 & Surface, clouds, wind fields
                    \
                    5 & WV6.2 & 6.25 & 5.35 & 7.15 & Water vapor, high level clouds,
                    atmospheric instability
                    \
                    6 & WV7.3 & 7.35 & 6.85 & 7.85 & Water vapor, atmospheric instability
                    \
                    7 & IR8.7 & 8.70 & 8.30 & 9.1 & Surface, clouds, atmospheric
                    instability
                    \
                    8 & IR9.7 & 9.66 & 9.38 & 9.94 & Ozone
                    \
                    9 & IR10.8 & 10.80 & 9.80 & 11.80 & Surface, clouds, wind fields,
                    atmospheric instability
                    \
                    10 & IR12.0 & 12.00 & 11.00 & 13.00 & Surface, clouds, atmospheric
                    instability
                    \
                    11 & IR13.4 & 13.40 & 12.40 & 14.40 & Cirrus cloud height, atmospheric instability \
                    12 & HRV & multicolumn{3}{c}{Broadband*} & Surface, clouds \
                    bottomrule
                    addlinespace
                    multicolumn{4}{l}{* about SIrange{0.4}{1.1}{micrometer}}
                    end{tabularx}
                    end{table}
                    end{document}






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered yesterday









                    daleifdaleif

                    33.1k254116




                    33.1k254116























                        4














                        a small variation of @daleif answer with considering coloring of rows from your answer. i also took a liberty and change column names:



                        enter image description here



                        documentclass[12pt]{article}
                        usepackage[table]{xcolor}
                        usepackage{booktabs, multirow, tabularx}
                        newcommandmrc[1]{linespread{0.8}selectfontbegin{tabular}[t]{@{} c @{}}#1end{tabular}}
                        usepackage[skip=1ex]{caption}
                        usepackage[range-phrase = --]{siunitx}

                        %---------------- show page layout. don't use in a real document!
                        usepackage{showframe}
                        renewcommandShowFrameLinethickness{0.15pt}
                        renewcommand*ShowFrameColor{color{red}}

                        begin{document}
                        begin{table}[h]
                        caption{Spectral channel characteristics of SEVIRI in terms of central, minimum and maximum wavelength of the channels and the main application areas of each channel.}
                        label{tab:channels}
                        renewcommandarraystretch{1.2}
                        setlengthtabcolsep{4pt}
                        rowcolors{3}{white}{gray!15}
                        begin{tabularx}{textwidth}{
                        p{2em}
                        p{3em}
                        S[table-format=2.3]
                        *{2}{S[table-format=1.3]}
                        >{raggedrightarraybackslash}X
                        }
                        toprule
                        &
                        & multicolumn{3}{c}{mrc{Spectral band\ characteristics (si{micrometer})}}
                        & \
                        cmidrule(lr){3-5}
                        multirow[b]{-3.3}{=}{Ch. No.}
                        & multirow[b]{-3.3}{=}{Band name}
                        & {$lambda_{mathrm{cen}}$}
                        & {$lambda_{min}$}
                        & {$lambda_{max}$}
                        & multirow[b]{-3}{linewidth}{Main observational application} \
                        hline
                        1 & VIS0.6 & 0.635 & 0.56 & 0.71 & Surface, clouds, wind fields \
                        2 & VIS0.8 & 0.81 & 0.74 & 0.88 & Surface, clouds, wind fields \
                        3 & NIR1.6 & 1.64 & 1.50 & 1.78 & Surface, cloud phase \
                        4 & IR3.9 & 3.90 & 3.48 & 4.36 & Surface, clouds, wind fields \
                        5 & WV6.2 & 6.25 & 5.35 & 7.15 & Water vapor, high level clouds, atmospheric instability \
                        6 & WV7.3 & 7.35 & 6.85 & 7.85 & Water vapor, atmospheric instability \
                        7 & IR8.7 & 8.70 & 8.30 & 9.1 & Surface, clouds, atmospheric instability \
                        8 & IR9.7 & 9.66 & 9.38 & 9.94 & Ozone \
                        9 & IR10.8 & 10.80 & 9.80 & 11.80 & Surface, clouds, wind fields, atmospheric instability \
                        10 & IR12.0 & 12.00 & 11.00 & 13.00 & Surface, clouds, atmospheric instability \
                        11 & IR13.4 & 13.40 & 12.40 & 14.40 & Cirrus cloud height, atmospheric instability \
                        12 & HRV & multicolumn{3}{c}{mrc{Broadband\(about SIrange{0.4}{1.1}{micrometer})}}
                        & Surface, clouds \
                        bottomrule
                        end{tabularx}





                        share|improve this answer






























                          4














                          a small variation of @daleif answer with considering coloring of rows from your answer. i also took a liberty and change column names:



                          enter image description here



                          documentclass[12pt]{article}
                          usepackage[table]{xcolor}
                          usepackage{booktabs, multirow, tabularx}
                          newcommandmrc[1]{linespread{0.8}selectfontbegin{tabular}[t]{@{} c @{}}#1end{tabular}}
                          usepackage[skip=1ex]{caption}
                          usepackage[range-phrase = --]{siunitx}

                          %---------------- show page layout. don't use in a real document!
                          usepackage{showframe}
                          renewcommandShowFrameLinethickness{0.15pt}
                          renewcommand*ShowFrameColor{color{red}}

                          begin{document}
                          begin{table}[h]
                          caption{Spectral channel characteristics of SEVIRI in terms of central, minimum and maximum wavelength of the channels and the main application areas of each channel.}
                          label{tab:channels}
                          renewcommandarraystretch{1.2}
                          setlengthtabcolsep{4pt}
                          rowcolors{3}{white}{gray!15}
                          begin{tabularx}{textwidth}{
                          p{2em}
                          p{3em}
                          S[table-format=2.3]
                          *{2}{S[table-format=1.3]}
                          >{raggedrightarraybackslash}X
                          }
                          toprule
                          &
                          & multicolumn{3}{c}{mrc{Spectral band\ characteristics (si{micrometer})}}
                          & \
                          cmidrule(lr){3-5}
                          multirow[b]{-3.3}{=}{Ch. No.}
                          & multirow[b]{-3.3}{=}{Band name}
                          & {$lambda_{mathrm{cen}}$}
                          & {$lambda_{min}$}
                          & {$lambda_{max}$}
                          & multirow[b]{-3}{linewidth}{Main observational application} \
                          hline
                          1 & VIS0.6 & 0.635 & 0.56 & 0.71 & Surface, clouds, wind fields \
                          2 & VIS0.8 & 0.81 & 0.74 & 0.88 & Surface, clouds, wind fields \
                          3 & NIR1.6 & 1.64 & 1.50 & 1.78 & Surface, cloud phase \
                          4 & IR3.9 & 3.90 & 3.48 & 4.36 & Surface, clouds, wind fields \
                          5 & WV6.2 & 6.25 & 5.35 & 7.15 & Water vapor, high level clouds, atmospheric instability \
                          6 & WV7.3 & 7.35 & 6.85 & 7.85 & Water vapor, atmospheric instability \
                          7 & IR8.7 & 8.70 & 8.30 & 9.1 & Surface, clouds, atmospheric instability \
                          8 & IR9.7 & 9.66 & 9.38 & 9.94 & Ozone \
                          9 & IR10.8 & 10.80 & 9.80 & 11.80 & Surface, clouds, wind fields, atmospheric instability \
                          10 & IR12.0 & 12.00 & 11.00 & 13.00 & Surface, clouds, atmospheric instability \
                          11 & IR13.4 & 13.40 & 12.40 & 14.40 & Cirrus cloud height, atmospheric instability \
                          12 & HRV & multicolumn{3}{c}{mrc{Broadband\(about SIrange{0.4}{1.1}{micrometer})}}
                          & Surface, clouds \
                          bottomrule
                          end{tabularx}





                          share|improve this answer




























                            4












                            4








                            4







                            a small variation of @daleif answer with considering coloring of rows from your answer. i also took a liberty and change column names:



                            enter image description here



                            documentclass[12pt]{article}
                            usepackage[table]{xcolor}
                            usepackage{booktabs, multirow, tabularx}
                            newcommandmrc[1]{linespread{0.8}selectfontbegin{tabular}[t]{@{} c @{}}#1end{tabular}}
                            usepackage[skip=1ex]{caption}
                            usepackage[range-phrase = --]{siunitx}

                            %---------------- show page layout. don't use in a real document!
                            usepackage{showframe}
                            renewcommandShowFrameLinethickness{0.15pt}
                            renewcommand*ShowFrameColor{color{red}}

                            begin{document}
                            begin{table}[h]
                            caption{Spectral channel characteristics of SEVIRI in terms of central, minimum and maximum wavelength of the channels and the main application areas of each channel.}
                            label{tab:channels}
                            renewcommandarraystretch{1.2}
                            setlengthtabcolsep{4pt}
                            rowcolors{3}{white}{gray!15}
                            begin{tabularx}{textwidth}{
                            p{2em}
                            p{3em}
                            S[table-format=2.3]
                            *{2}{S[table-format=1.3]}
                            >{raggedrightarraybackslash}X
                            }
                            toprule
                            &
                            & multicolumn{3}{c}{mrc{Spectral band\ characteristics (si{micrometer})}}
                            & \
                            cmidrule(lr){3-5}
                            multirow[b]{-3.3}{=}{Ch. No.}
                            & multirow[b]{-3.3}{=}{Band name}
                            & {$lambda_{mathrm{cen}}$}
                            & {$lambda_{min}$}
                            & {$lambda_{max}$}
                            & multirow[b]{-3}{linewidth}{Main observational application} \
                            hline
                            1 & VIS0.6 & 0.635 & 0.56 & 0.71 & Surface, clouds, wind fields \
                            2 & VIS0.8 & 0.81 & 0.74 & 0.88 & Surface, clouds, wind fields \
                            3 & NIR1.6 & 1.64 & 1.50 & 1.78 & Surface, cloud phase \
                            4 & IR3.9 & 3.90 & 3.48 & 4.36 & Surface, clouds, wind fields \
                            5 & WV6.2 & 6.25 & 5.35 & 7.15 & Water vapor, high level clouds, atmospheric instability \
                            6 & WV7.3 & 7.35 & 6.85 & 7.85 & Water vapor, atmospheric instability \
                            7 & IR8.7 & 8.70 & 8.30 & 9.1 & Surface, clouds, atmospheric instability \
                            8 & IR9.7 & 9.66 & 9.38 & 9.94 & Ozone \
                            9 & IR10.8 & 10.80 & 9.80 & 11.80 & Surface, clouds, wind fields, atmospheric instability \
                            10 & IR12.0 & 12.00 & 11.00 & 13.00 & Surface, clouds, atmospheric instability \
                            11 & IR13.4 & 13.40 & 12.40 & 14.40 & Cirrus cloud height, atmospheric instability \
                            12 & HRV & multicolumn{3}{c}{mrc{Broadband\(about SIrange{0.4}{1.1}{micrometer})}}
                            & Surface, clouds \
                            bottomrule
                            end{tabularx}





                            share|improve this answer















                            a small variation of @daleif answer with considering coloring of rows from your answer. i also took a liberty and change column names:



                            enter image description here



                            documentclass[12pt]{article}
                            usepackage[table]{xcolor}
                            usepackage{booktabs, multirow, tabularx}
                            newcommandmrc[1]{linespread{0.8}selectfontbegin{tabular}[t]{@{} c @{}}#1end{tabular}}
                            usepackage[skip=1ex]{caption}
                            usepackage[range-phrase = --]{siunitx}

                            %---------------- show page layout. don't use in a real document!
                            usepackage{showframe}
                            renewcommandShowFrameLinethickness{0.15pt}
                            renewcommand*ShowFrameColor{color{red}}

                            begin{document}
                            begin{table}[h]
                            caption{Spectral channel characteristics of SEVIRI in terms of central, minimum and maximum wavelength of the channels and the main application areas of each channel.}
                            label{tab:channels}
                            renewcommandarraystretch{1.2}
                            setlengthtabcolsep{4pt}
                            rowcolors{3}{white}{gray!15}
                            begin{tabularx}{textwidth}{
                            p{2em}
                            p{3em}
                            S[table-format=2.3]
                            *{2}{S[table-format=1.3]}
                            >{raggedrightarraybackslash}X
                            }
                            toprule
                            &
                            & multicolumn{3}{c}{mrc{Spectral band\ characteristics (si{micrometer})}}
                            & \
                            cmidrule(lr){3-5}
                            multirow[b]{-3.3}{=}{Ch. No.}
                            & multirow[b]{-3.3}{=}{Band name}
                            & {$lambda_{mathrm{cen}}$}
                            & {$lambda_{min}$}
                            & {$lambda_{max}$}
                            & multirow[b]{-3}{linewidth}{Main observational application} \
                            hline
                            1 & VIS0.6 & 0.635 & 0.56 & 0.71 & Surface, clouds, wind fields \
                            2 & VIS0.8 & 0.81 & 0.74 & 0.88 & Surface, clouds, wind fields \
                            3 & NIR1.6 & 1.64 & 1.50 & 1.78 & Surface, cloud phase \
                            4 & IR3.9 & 3.90 & 3.48 & 4.36 & Surface, clouds, wind fields \
                            5 & WV6.2 & 6.25 & 5.35 & 7.15 & Water vapor, high level clouds, atmospheric instability \
                            6 & WV7.3 & 7.35 & 6.85 & 7.85 & Water vapor, atmospheric instability \
                            7 & IR8.7 & 8.70 & 8.30 & 9.1 & Surface, clouds, atmospheric instability \
                            8 & IR9.7 & 9.66 & 9.38 & 9.94 & Ozone \
                            9 & IR10.8 & 10.80 & 9.80 & 11.80 & Surface, clouds, wind fields, atmospheric instability \
                            10 & IR12.0 & 12.00 & 11.00 & 13.00 & Surface, clouds, atmospheric instability \
                            11 & IR13.4 & 13.40 & 12.40 & 14.40 & Cirrus cloud height, atmospheric instability \
                            12 & HRV & multicolumn{3}{c}{mrc{Broadband\(about SIrange{0.4}{1.1}{micrometer})}}
                            & Surface, clouds \
                            bottomrule
                            end{tabularx}






                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited yesterday

























                            answered yesterday









                            ZarkoZarko

                            126k868165




                            126k868165























                                2














                                Thanks for all the responses! So, I've been playing with tabularx and saw someone define a type of column in the preamble in a previous posting:



                                newcolumntype{Y}{>{centeringarraybackslash}X}


                                So now, when I specify the middle three columns as Y and tweaking my column size a bit (also, l, c, and r don't accept sizing, that's why I was getting the error, I switched to p, m and b of the array package):



                                begin{tabularx}{textwidth}{p{3.5em} p{3.5em} Y Y Y p{10em}}


                                I get very close to what I was looking for:



                                New Table



                                (Sorry about the dark rows, I am also playing with rowcolors).



                                Thanks again for the input!






                                share|improve this answer


























                                • Thanks for the tip about the SI units too, I will keep them in mind for the future.

                                  – Adrian
                                  yesterday






                                • 1





                                  You said "saw someone ...". I think you should add his/her user-name here (for the credit).

                                  – JouleV
                                  yesterday






                                • 1





                                  Ah yes, sure, that would be Mico. Thanks Mico!

                                  – Adrian
                                  yesterday











                                • @Adrian - Thanks for the shout-out. :-)

                                  – Mico
                                  yesterday











                                • So, just to update, I also did some raggedright modification of the last p column to get rid of the spaces due to justification. The relevant command is begin{tabularx}{textwidth}{p{3.5em} p{3.5em} Y Y Y >{raggedrightarraybackslash}p{10em}}, as proposed by Saravanan.

                                  – Adrian
                                  yesterday
















                                2














                                Thanks for all the responses! So, I've been playing with tabularx and saw someone define a type of column in the preamble in a previous posting:



                                newcolumntype{Y}{>{centeringarraybackslash}X}


                                So now, when I specify the middle three columns as Y and tweaking my column size a bit (also, l, c, and r don't accept sizing, that's why I was getting the error, I switched to p, m and b of the array package):



                                begin{tabularx}{textwidth}{p{3.5em} p{3.5em} Y Y Y p{10em}}


                                I get very close to what I was looking for:



                                New Table



                                (Sorry about the dark rows, I am also playing with rowcolors).



                                Thanks again for the input!






                                share|improve this answer


























                                • Thanks for the tip about the SI units too, I will keep them in mind for the future.

                                  – Adrian
                                  yesterday






                                • 1





                                  You said "saw someone ...". I think you should add his/her user-name here (for the credit).

                                  – JouleV
                                  yesterday






                                • 1





                                  Ah yes, sure, that would be Mico. Thanks Mico!

                                  – Adrian
                                  yesterday











                                • @Adrian - Thanks for the shout-out. :-)

                                  – Mico
                                  yesterday











                                • So, just to update, I also did some raggedright modification of the last p column to get rid of the spaces due to justification. The relevant command is begin{tabularx}{textwidth}{p{3.5em} p{3.5em} Y Y Y >{raggedrightarraybackslash}p{10em}}, as proposed by Saravanan.

                                  – Adrian
                                  yesterday














                                2












                                2








                                2







                                Thanks for all the responses! So, I've been playing with tabularx and saw someone define a type of column in the preamble in a previous posting:



                                newcolumntype{Y}{>{centeringarraybackslash}X}


                                So now, when I specify the middle three columns as Y and tweaking my column size a bit (also, l, c, and r don't accept sizing, that's why I was getting the error, I switched to p, m and b of the array package):



                                begin{tabularx}{textwidth}{p{3.5em} p{3.5em} Y Y Y p{10em}}


                                I get very close to what I was looking for:



                                New Table



                                (Sorry about the dark rows, I am also playing with rowcolors).



                                Thanks again for the input!






                                share|improve this answer















                                Thanks for all the responses! So, I've been playing with tabularx and saw someone define a type of column in the preamble in a previous posting:



                                newcolumntype{Y}{>{centeringarraybackslash}X}


                                So now, when I specify the middle three columns as Y and tweaking my column size a bit (also, l, c, and r don't accept sizing, that's why I was getting the error, I switched to p, m and b of the array package):



                                begin{tabularx}{textwidth}{p{3.5em} p{3.5em} Y Y Y p{10em}}


                                I get very close to what I was looking for:



                                New Table



                                (Sorry about the dark rows, I am also playing with rowcolors).



                                Thanks again for the input!







                                share|improve this answer














                                share|improve this answer



                                share|improve this answer








                                edited yesterday









                                JouleV

                                4,96611239




                                4,96611239










                                answered yesterday









                                AdrianAdrian

                                76116




                                76116













                                • Thanks for the tip about the SI units too, I will keep them in mind for the future.

                                  – Adrian
                                  yesterday






                                • 1





                                  You said "saw someone ...". I think you should add his/her user-name here (for the credit).

                                  – JouleV
                                  yesterday






                                • 1





                                  Ah yes, sure, that would be Mico. Thanks Mico!

                                  – Adrian
                                  yesterday











                                • @Adrian - Thanks for the shout-out. :-)

                                  – Mico
                                  yesterday











                                • So, just to update, I also did some raggedright modification of the last p column to get rid of the spaces due to justification. The relevant command is begin{tabularx}{textwidth}{p{3.5em} p{3.5em} Y Y Y >{raggedrightarraybackslash}p{10em}}, as proposed by Saravanan.

                                  – Adrian
                                  yesterday



















                                • Thanks for the tip about the SI units too, I will keep them in mind for the future.

                                  – Adrian
                                  yesterday






                                • 1





                                  You said "saw someone ...". I think you should add his/her user-name here (for the credit).

                                  – JouleV
                                  yesterday






                                • 1





                                  Ah yes, sure, that would be Mico. Thanks Mico!

                                  – Adrian
                                  yesterday











                                • @Adrian - Thanks for the shout-out. :-)

                                  – Mico
                                  yesterday











                                • So, just to update, I also did some raggedright modification of the last p column to get rid of the spaces due to justification. The relevant command is begin{tabularx}{textwidth}{p{3.5em} p{3.5em} Y Y Y >{raggedrightarraybackslash}p{10em}}, as proposed by Saravanan.

                                  – Adrian
                                  yesterday

















                                Thanks for the tip about the SI units too, I will keep them in mind for the future.

                                – Adrian
                                yesterday





                                Thanks for the tip about the SI units too, I will keep them in mind for the future.

                                – Adrian
                                yesterday




                                1




                                1





                                You said "saw someone ...". I think you should add his/her user-name here (for the credit).

                                – JouleV
                                yesterday





                                You said "saw someone ...". I think you should add his/her user-name here (for the credit).

                                – JouleV
                                yesterday




                                1




                                1





                                Ah yes, sure, that would be Mico. Thanks Mico!

                                – Adrian
                                yesterday





                                Ah yes, sure, that would be Mico. Thanks Mico!

                                – Adrian
                                yesterday













                                @Adrian - Thanks for the shout-out. :-)

                                – Mico
                                yesterday





                                @Adrian - Thanks for the shout-out. :-)

                                – Mico
                                yesterday













                                So, just to update, I also did some raggedright modification of the last p column to get rid of the spaces due to justification. The relevant command is begin{tabularx}{textwidth}{p{3.5em} p{3.5em} Y Y Y >{raggedrightarraybackslash}p{10em}}, as proposed by Saravanan.

                                – Adrian
                                yesterday





                                So, just to update, I also did some raggedright modification of the last p column to get rid of the spaces due to justification. The relevant command is begin{tabularx}{textwidth}{p{3.5em} p{3.5em} Y Y Y >{raggedrightarraybackslash}p{10em}}, as proposed by Saravanan.

                                – Adrian
                                yesterday


















                                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%2f478039%2fhow-to-fix-my-table-centering-of-columns%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

                                How to label and detect the document text images

                                Vallis Paradisi

                                Tabula Rosettana