Graphics, Figures & TablesHow do I remove thick line and centre my text in the table?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
ujjwal_11138
Posts: 4
Joined: Sun Mar 28, 2021 11:31 pm

How do I remove thick line and centre my text in the table?

Post by ujjwal_11138 »

Hi, I am trying to make a table but somehow I am getting a thick line (marked in red). How do I remove it?
Also, how do I centre my text in 'grades' column (see attached file)?
Attachments
latex_table_issue.JPG
latex_table_issue.JPG (109.7 KiB) Viewed 2348 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

How do I remove thick line and centre my text in the table?

Post by Bartman »

Please create a Infominimal working example and don't insert its source code as a screenshot, but with the help of the editor, so that others can test it right here in the forum.

Remove the vertical line before the column type of the second \multicolumn command so that the thickness of the line is the same as that of the other lines.

You can replace the column type p with m of the array package or use the tabularx package and its column type suggested by me.

Code: Select all

\documentclass{beamer}
\usepackage[english]{babel}
\usepackage{tabularx}% loads array
\usepackage{ragged2e}% provides \RaggedRight
\usepackage{showframe}

\begin{document}
{\renewcommand{\tabularxcolumn}[1]{>{\RaggedRight}m{#1}}
\begin{frame}{Course Work}
  \centering
  \footnotesize
  \begin{tabularx}{\linewidth}{|X|c|X|c|}
    \hline
    \multicolumn{1}{|c|}{Monsoon 2019--20} & Grades
    & \multicolumn{1}{c|}{Winter 2019--20} & Grades\\
    \hline
    Research Methodology and Statistics (MEC 591) & B 
    & Laser Processing of Materials (MED 553) & A+\\
    \hline
  \end{tabularx}
\end{frame}}
\end{document}
ujjwal_11138
Posts: 4
Joined: Sun Mar 28, 2021 11:31 pm

How do I remove thick line and centre my text in the table?

Post by ujjwal_11138 »

Thanks a lot, Bartman. Sorry for the inconvenience. I will be more careful in future.
Post Reply