Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
684 views
in Technique[技术] by (71.8m points)

latex - Getting weird form of table

Hi all if anyone can help me. I am new to latex. I am trying to add table in my latex. I know the format but i don't know what I am doing wrong because my table is not in the form I want moreover it is giving me the error when I add caption.

I need some thing like this in the image

enter image description here

but I am getting this when I compile my latex code

enter image description here

Here is my code:

egin{center}
 egin{tabular}[!ht]{||c c ||} 
        caption{Dataset Specifications}
        centering label{data}
 hline
 Dataset & Samples \ [0.5ex] 
 hlinehline
 Vovid & 349 \ 
 hline
 noncovid & 397  \ [1ex] 
 hline


end{tabular}
end{center}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

My minimal code:

documentclass{article}

setlength{abcolsep}{1em}

enewcommand{arraystretch}{1.5}

egin{document}

egin{table}[htbp]
  centering
  egin{tabular}{|c|c|}
    hline
    Dataset & Samples \
    hline
    Covid & 349 \ 
    Non Covid & 397 \
    hline
  end{tabular}
  caption{Dataset Specifications}
  label{tab:data}
end{table}

end{document}

and its output:

screenshot of output

Please comment below here if any feature is missing or something is not clear to you :)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...