2

I have work from my campus, but, not all is learned, so I must develop this script, so, I have problem about text and table. I need to compile like this.

I have use \hline but that will line everything up.

EXAMPLE

\documentclass[a4, 12pt]{article}
\usepackage[bahasa]{babel}
\begin{flushleft}
    \begin{tabular}{l|l|l|l|l|l|}
    \hline
    Nama    : Justin & No & KD-MK & Mata Kuliah & SKS & Kelas
    \end{tabular}
\end{flushleft}
\end{document}
  • 2
    It is a4paper, not a4. Btw you don't have \begin{document}. – The old JouleV Apr 25 at 15:37
  • I was taught to use a4 not a4paper, maybe from the teacher it was wrong, thanks for ur correction. I deleted some code, because I think if I post everything will be long – JokerZA Apr 25 at 17:30
1

You can use command cline{2-6} like this:

\documentclass[a4paper, 12pt]{article}

\usepackage[bahasa]{babel}

\begin{document} % <====================================================
\begin{flushleft}
\begin{tabular}{l|l|l|l|l|l|}
  \cline{2-6} % <=======================================================
  Nama    : Justin & No & KD-MK       & Mata Kuliah & SKS & Kelas \\
  \cline{2-6} % <=======================================================
  Class   : 1CCAB  & 1  & Geographics & IT11234     &     &       \\
  \cline{2-6} % <=======================================================
\end{tabular}
\end{flushleft}
\end{document}

with the result:

resulting table

But better would be the following table I think (see the starting column divided in three with lcl):

\documentclass[a4paper, 12pt]{article}

\usepackage[bahasa]{babel}

\begin{document} % <====================================================
\begin{flushleft}
\begin{tabular}{lcl|l|l|l|l|l|}
  \cline{4-8} % <=======================================================
  Nama &:& Justin & No & KD-MK       & Mata Kuliah & SKS & Kelas \\
  \cline{4-8} % <=======================================================
  Class&:& 1CCAB  & 1  & Geographics & IT11234     &     &       \\
  \cline{4-8} % <=======================================================
       & &        & 2  & Geographics & IT11235     &     &       \\
  \cline{4-8} % <=======================================================
\end{tabular}
\end{flushleft}
\end{document}

and the result:

result two

  • why at syntax \cline use 4-8 – JokerZA Apr 25 at 17:31

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.