5
\documentclass[a4paper]{article}
\usepackage[cjk]{kotex}
\usepackage{enumerate, float, pgf, tikz, circuitikz, multirow, tabularx, longtable, pdfpages, makecell, hyperref, array, siunitx, diagbox}
%\usepackage[inline]{enumitem}
%\usepackage{showframe}
\setlength{\textheight}{10.75in}
\setlength{\textwidth}{6.5in}
\setlength{\voffset}{-1.5in}
\setlength{\hoffset}{-0.863285in}
\setlength{\marginparwidth}{0in}
\setlength{\marginparpush}{0in}
\hypersetup{pdfborder= 0 0 0}
\title{Example}
\author{Example}
\begin{document}
    \maketitle
        \begin{center}
        \renewcommand{\arraystretch}{1.3}
        \begin{tabular}{|c|c|c|c|c|c|}
            \hline
            \multicolumn{2}{|c|}{\diagbox{Procedure}{Voltage [\SI{}{\volt}]}} & \thead{1st: 3.606\\ 2nd: 3.02195} & \thead{1st: 5.068\\ 2nd: 5.042} & \thead{1st: 7.064\\ 2nd: 7.0115} & \thead{1st: 9.062\\ 2nd: 9.069}\\
            \hline
            Step (b) & \multirow{2}{*}{Current $I$ [\SI{}{\milli\ampere}]} & 13.4703025775 & 18.9316398954 & 26.3877474785 & 33.8513261113\\
            \cline{1-1}\cline{3-6}
            Step (d) & & 2.54715947404 & 4.24983142279 & 5.90989548213 & 7.64413351315\\
            \hline
        \end{tabular}
    \end{center}
\end{document}

Table

This is tabular portion of my code. However, the ends of diagonal line dividing first coloumn don't seem to meet the corner of the cell. I posted this because I wasn't able to find my case.

2
  • Welcome to TeX SX! Please post a complete compilable code – Bernard Mar 31 '19 at 11:27
  • I added compilable code – Andrew Cho Mar 31 '19 at 11:37
4

Here is a solution, using \multirowcell in the place of \multirow. I removed the unnecessary packages for the problem at hand. Also, I took the opportunity to simplify and improve the code, in particular using the S column type for the last four columns:

\documentclass[a4paper]{article}
\usepackage{multirow, tabularx, longtable, makecell, diagbox}
\usepackage{siunitx}
\usepackage{hyperref}
%\usepackage[inline]{enumitem}
\usepackage{showframe}
\renewcommand{\ShowFrameLinethickness}{0.3pt}
\setlength{\textheight}{10.75in}
\setlength{\textwidth}{6.5in}
\setlength{\voffset}{-1.5in}
\setlength{\hoffset}{-0.863285in}
\setlength{\marginparwidth}{0in}
\setlength{\marginparpush}{0in}
\hypersetup{pdfborder= 0 0 0}
\title{Example}
\author{Example}

\begin{document}

    \maketitle

        \begin{center}
        \renewcommand{\arraystretch}{1.3}
        \sisetup{table-format=2.11, table-number-alignment=center}
        \begin{tabular}{|c|c|*{4}{S|}}
            \hline
            \multicolumn{2}{|c|}{\diagbox{Procedure}{Voltage [\si{\V}]}} & {\thead{1st: 3.606\\ 2nd: 3.02195}} & {\thead{1st: 5.068\\ 2nd: 5.042}} & {\thead{1st: 7.064\\ 2nd: 7.0115}} & {\thead{1st: 9.062\\ 2nd: 9.069}}\\
            \hline
            Step (b) & \multirowcell{2}{Current $I$ \\[-0.5ex][\si{\mA}]} & 13.4703025775 & 18.9316398954 & 26.3877474785 & 33.8513261113\\
            \cline{1-1}\cline{3-6}
            Step (d) & & 2.54715947404 & 4.24983142279 & 5.90989548213 & 7.64413351315\\
            \hline
        \end{tabular}
    \end{center}

\end{document} 

enter image description here

2
  • Thank you so much for answering the question. May I ask why multirowcell produces different result? – Andrew Cho Mar 31 '19 at 13:17
  • That's because I used two lines, so the second column is not so large as it was. The other possibilities iw to play with width, as in @leandriis'answer, or with height (the latter being by trial and error). – Bernard Mar 31 '19 at 13:21
4

With the help of the optional width argument of \diagbox you can achieve the following:

enter image description here

\documentclass[a4paper]{article}
\usepackage[cjk]{kotex}
\usepackage{enumerate, float, pgf, tikz, circuitikz, multirow, tabularx, longtable, pdfpages, makecell, hyperref, array, siunitx, diagbox}
\usepackage{calc}


\setlength{\textheight}{10.75in}
\setlength{\textwidth}{6.5in}
\setlength{\voffset}{-1.5in}
\setlength{\hoffset}{-0.863285in}
\setlength{\marginparwidth}{0in}
\setlength{\marginparpush}{0in}
\hypersetup{pdfborder= 0 0 0}

\begin{document}

        \begin{center}
        \renewcommand{\arraystretch}{1.3}
        \begin{tabular}{|c|c|c|c|c|c|}
            \hline
            \multicolumn{2}{|c|}{\diagbox[width=\widthof{Step (b)}+\widthof{Current $I$ [\SI{}{\milli\ampere}]}+4\tabcolsep+\arrayrulewidth\relax]{Procedure}{Voltage [\SI{}{\volt}]}} & \thead{1st: 3.606\\ 2nd: 3.02195} & \thead{1st: 5.068\\ 2nd: 5.042} & \thead{1st: 7.064\\ 2nd: 7.0115} & \thead{1st: 9.062\\ 2nd: 9.069}\\
            \hline
            Step (b) & \multirow{2}{*}{Current $I$ [\SI{}{\milli\ampere}]} & 13.4703025775 & 18.9316398954 & 26.3877474785 & 33.8513261113\\
            \cline{1-1}\cline{3-6}
            Step (d) & & 2.54715947404 & 4.24983142279 & 5.90989548213 & 7.64413351315\\
            \hline
        \end{tabular}
    \end{center}
\end{document}
2
  • Thank you so much for answering. I was so frustrated by this... – Andrew Cho Mar 31 '19 at 11:53
  • @AndrewCho Don't worry. There are very good experts here. – Sebastiano Mar 31 '19 at 11:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.