TransWikia.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!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP