0

I am trying to recreate the following pictureenter image description here and here is my attemt:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{array}
\usepackage{arydshln}
\begin{document}
\begin{tabular}{|b{3cm} b{3cm}|}
     \hline
     \begin{tabular}{b{2cm}}
        Name\\
         \hdashline
     \end{tabular}&
     \begin{tabular}{b{2cm}}
     Phone\\
     \hdashline
     \end{tabular}\\

   Roberts,Sherry&
   \begin{tabular}{b{2cm}}
    ~\\
    \hdashline
    \end{tabular}\\

    ~&~\\
    \hline
\end{tabular}
\end{document}

As you can see, the output is unsatisfactory.unsatisfactory

Specifically, I don't know how to lower the text to just immediately above the line. I specifically chose b{2cm} instead of the normal p{2cm}, but the effect is not clear to me. I checked to see cell padding but it seems what folks meant by that term is enlarging the space in a cell rather than decreasing the space. So I don't have any luck here.

Any suggestion about how to achieve what I have in mind will be greatly appreiciated.

1

I think you want much simpler markup, more like

enter image description here

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{array}

\begin{document}
\setlength\extrarowheight{2pt}
\begin{tabular}{|p{3cm} p{3cm}|}
\hline
Name&Phone\\[-8pt]
\dotfill&\dotfill\\
Roberts,Sherry&\dotfill\\
\hline
\end{tabular}
\end{document}
2
  • This is indeed a much more elegant solution. Thank you! Also, if you don't mind me asking. Why do you use \setlength\extrarowheight{2pt}command?
    – jxhyc
    Apr 30 '20 at 13:31
  • @jxhyc delete that line and see. The hline rules will be very close to the text that adds 2pt extra height in each row, makes hline look nicer normally Apr 30 '20 at 13:57

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.