TransWikia.com

my table is not fitting in IEEE conference format . How to make it fit in

TeX - LaTeX Asked by Muthukumar K.A. on December 19, 2020

begin{table}
begin{center}
caption{An environmental details for the experiment.}
begin{tabular}{ | c | c | }
hline
    Room & Living room    hline
    Sensors and camera position & Ceiling    hline
    Sensor and camera Distance from floor  & 2.6 m  hline    
    Room Temperature & $24^{circ}$C    hline
    Subject & Human    hline
    Position of subject to sensor & All positions possible     hline
    Activities & Walking, Sitting, Standing, Falling, Lying, Action change     hline
    Subject & 5 person   hline
end{tabular}
label{exp}
end{center}
end{table}

2 Answers

  • Your need to break cell contents in your table on two lines. For examples by use of the tabularx table (defined in the package of the same name).
  • For units I would use siunitx.
  • For better table design see @mico answer.
  • I would type your table as follows:
documentclass{ieeetran}
usepackage{lipsum}

usepackage{makecell, tabularx}
newcolumntype{L}{>{raggedrightarraybackslash}X}
usepackage{siunitx}

begin{document}
lipsum[1]
    begin{table}[ht]
    setcellgapes{2pt}
    makegapedcells
centering
caption{An environmental details for the experiment.}
label{exp}
begin{tabularx}{linewidth}{ |l | L | }
hline
    Room & Living room    hline
    Sensors and camera position & Ceiling    hline
    Sensor and camera Distance from floor  & SI{2.6}{m}  hline
    Room Temperature & SI{24}{celsius}    hline
    Subject & Human    hline
    Position of subject to sensor & All positions possible     hline
    Activities & Walking, Sitting, Standing, Falling, Lying, Action change     hline
    Subject & 5 person   hline
end{tabularx}
    end{table}
lipsum[2-7]
end{document}

enter image description here

Answered by Zarko on December 19, 2020

The table doesn't fit within the width of a column because line breaking isn't enabled.

I suggest you switch from a tabular to a tabularx environment, set its width to columnwidth, and use X-type columns to permit line-breaking inside cells. In the solution shown below, I define a new column type, called L, which is based on the X column type and performs hanging indentation. I recommend left-aligning rather than centering both columns. I would also like to suggest that you give the table a much more open "look" by omitting all vertical lines and using fewer, but well spaced horizontal lines. Finally, to typeset numbers and their associated units, do employ the SI macro of the siunitx package.

enter image description here

documentclass[conference]{IEEEtran}
usepackage{booktabs,siunitx}
usepackage{tabularx,ragged2e}
newcolumntype{L}{>{RaggedRighthangafter=1hangindent=1em}X}
begin{document}

begin{table}
caption{Environmental details for experiment.}
label{exp}
begin{tabularx}{columnwidth}{ @{} LL @{} }
toprule
  Room & Living room   
midrule % optional, feel free to omit
  Sensors and camera position & Ceiling   
  Sensor and camera distance from floor & SI{2.6}{meter}    
  Room Temperature & SI{24}{celsius}   
  Subject & Human   
  Position of subject to sensor & All positions possible   
  Activities & Walking, sitting, standing, falling, lying, action change   
  Subject & 5 persons   
bottomrule
end{tabularx}
end{table}
end{document}

Answered by Mico 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