AnswerBun.com

Lines for all the rows in separate columns

TeX - LaTeX Asked on December 19, 2020

Is it possible to have lines for all the rows in the last two columns 7 and 8?
Is it also possible to have an empty space in the first column at the last two rows?

begin{table}[H]
        centering
        caption{textit{Beräkning av K$_{OW}$}.}
        begin{tabular}[ht]{|c!{vrule width 2pt}c|c|c|c!{vrule width 2pt}c|c|c|}
            hline
            
 multirow{7}{*}{ rotatebox{90}{textbf{Tetrabutyl}} } & Bindning & f$_i$  & n$_i$ & Produkt & multirow{7}{*}{ rotatebox{90}{textbf{PFBS}} } &  n$_i$ & Produkt   \ cline{2-5}
 &-CH$_3$  &0,5473  &4 &2,1892 &  & &\ cline{2-5}
 &-CH$_2$  &0,4911  & 12& 5,8932 & & &\ cline{2-5}
 &-SO$_2$O &-0,7250 &1 & -0,7250 & & &\ cline{2-5}
 &-F       &-0,0031 &9 & -0,0279 & & &\ cline{2-5}
 &-P=O     & -2,4239 & 1 & -2,4239 & & &\ cline{2-5}
 &-O-H     & -1,4086& - & - &    & &\ hline


 multicolumn{4}{|c|}{Koefficient} & 0,229   \ cline{1-5}
  multicolumn{4}{|c|}{Summa} & 5,1346  \ cline{1-8}



        end{tabular}
        label{tabell: Fysiokemiska}
end{table}

enter image description here

2 Answers

Something like this?

enter image description here

documentclass{article}
usepackage[swedish]{babel}
usepackage{graphicx,array,multirow}
usepackage{mhchem}       % for 'ce' macro, for chemical compounts
usepackage{letterspace}  % for 'textls' macro
usepackage[output-decimal-marker={,}]{siunitx} % for 'S' column type
begin{document}
begin{table}[ht!]
 setlengthextrarowheight{1.6pt} %  2pt seems too thick
 centering
 caption{textit{Beräkning av Ktextsubscript{OW}}.strut}
 label{tabell:Fysiokemiska}
 begin{tabular}{|c !{vrule width1.6pt}
                  l|
                  S[table-format=-1.4]|
                  S[table-format= 2.0]|
                  S[table-format=-1.4] !{vrule width1.6pt}
                  c|
                  c|
                  c|}
 hline        
   multirow{7}{*}{rotatebox{90}{textbf{Tetrabutyl }}} 
 & {Bindning} & {$f_i$} & {$n_i$} & {Produkt}
 & multirow{7}{*}{rotatebox{90}{textbf{textls{PFBS }}}} 
 & $n_i$ & Produkt \                          cline{2-5} cline{7-8}
 &-ce{CH3}  &  0,5473  &  4&  2,1892 & & & \ cline{2-5} cline{7-8}
 &-ce{CH2}  &  0,4911  & 12&  5,8932 & & & \ cline{2-5} cline{7-8}
 &-ce{SO2O} & -0,7250  &  1& -0,7250 & & & \ cline{2-5} cline{7-8}
 &-ce{F}    & -0,0031  &  9& -0,0279 & & & \ cline{2-5} cline{7-8}
 &-ce{P=O}  & -2,4239  &  1& -2,4239 & & & \ cline{2-5} cline{7-8}
 &-ce{O-H}  & -1,4086  &{--}& {--}   & & & \ hline
 multicolumn{1}{c !{vrule width1.6pt}}{}
 & multicolumn{3}{r|}{Koefficient} & 0,229  \ cline{2-5}
 multicolumn{1}{c !{vrule width1.6pt}}{}
 & multicolumn{3}{r|}{Summa}       & 5,1346 \ cline{2-5}
 end{tabular}
 
end{table}
end{document}

Correct answer by Mico on December 19, 2020

Always it is necessary insert to table all ampersands: n-1 if you have n columns. Adding missed ampersands in the last two rows -- there are missed three &, will solve your problem.

However, your table can be done nicer (at least to my opinion), if you consider in it design packages siunitx, mhchem and makecell and for caption caption:

enter image description here

    begin{table}[ht]
    centering
    setcellgapes{2pt}
    makegapedcells
caption{Beräkning av $K_{OW}$.}
label{tabell: Fysiokemiska}
begin{tabular}{|c!{vrule width 2pt}l|S[table-format=-1.4]|
                                       S[table-format= 2.0]|
                                       S[table-format=-1.4]!{vrule width 2pt}
                                       c|c|c|}
    hline
 multirow{7}{*}{ rotatebox{90}{textbf{Tetrabutyl}} } 
    & Bindning      & {$f_i$}   & {$n_i$} & {Produkt} & multirow{7}{*}{ rotatebox{90}{textbf{PFBS}} } 
                                                        & $n_i$ & Produkt   \ cline{2-5}
    & ce{-CH3}     &  0,5473   &  4    &  2,1892   &   &       &\ cline{2-5}
    & ce{-CH2}     &  0,4911   & 12    &  5,8932   &   &       &\ cline{2-5}
    & ce{-SO2O}    & -0,7250   &  1    & -0,7250   &   &       &\ cline{2-5}
    & ce{-F}       & -0,0031   &  9    & -0,0279   &   &       &\ cline{2-5}
    & ce{-P-O}     & -2,4239   &  1    & -2,4239   &   &       &\ cline{2-5}
    & ce{-O=H}     & -1,4086   & {--}  & {--}      &   &       &\ 
    hline
mcc[4]{Koefficient}            & 0,229             &   &       &\ hline
mcc[4]{Summa}                  & 5,1346            &   &       &\ hline
end{tabular}
    end{table}

Answered by Zarko on December 19, 2020

Add your own answers!

Related Questions

What makes up each TeX Live install-tl scheme?

1  Asked on February 18, 2021 by fire-bee

     

Problems with nocite

1  Asked on February 18, 2021

   

Table caption floats over table cells

0  Asked on February 18, 2021 by elbatoul

       

Best way to list symbols in Latex

0  Asked on February 18, 2021 by edmund-blackadder

   

design a beamer presentation

1  Asked on February 18, 2021 by guille-carrion

 

Getting fontspec Fonts with pdfLaTeX

1  Asked on February 18, 2021 by cari-baur

         

Disabling colored borders in pdf with bookmark package

2  Asked on February 18, 2021 by hester

   

Unwanted Extra Circles in Tikz Neural Network (LaTeX)

1  Asked on February 18, 2021 by usr1729

   

Gantt chart spacing, time unit change

0  Asked on February 18, 2021 by sara-ismail-sutton

       

catoptions/menukeys packages compilation error

2  Asked on February 18, 2021 by ejazz

   

How to define a command that defines macro with default value

1  Asked on February 18, 2021 by shalom-alecheim

   

pgfplots: Log-Log Graph Missing Grid Lines

1  Asked on February 18, 2021 by grfrazee

 

What to download, proTeXt or MiKTeX?

2  Asked on February 18, 2021 by benregn

       

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir