Graphics, Figures & Tableshyperref | Text Field inside the Table Cell

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
usr345
Posts: 37
Joined: Fri Apr 01, 2011 11:39 pm

hyperref | Text Field inside the Table Cell

Post by usr345 »

I have a table cell with an input field inside.

Code: Select all

\documentclass{article}
\usepackage{hyperref}

\begin{document}
  \begin{Form}
    \begin{tabular}{|l|}
      \hline
      \TextField[name=textfield,width=3cm,height=0.2cm,value=default]{Text} \\
      \hline
    \end{tabular}
  \end{Form}
\end{document}
And there some questions that bother me.
  1. How to create a padding between the table border and input border?
  2. How to make the border of all the inputs black and thin? So I won't need to set the property bordercolor={0 0 0} for every input I create.
Attachments
tikz18.png
tikz18.png (4.65 KiB) Viewed 7434 times

Recommended reading 2024:

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

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

hpesoj626
Posts: 7
Joined: Thu Nov 01, 2012 4:27 pm

hyperref | Text Field inside the Table Cell

Post by hpesoj626 »

I don't know if this will answer your question. One approach is to thicken the table line instead. Here is one possibility.

Code: Select all

\documentclass{article}
\usepackage{xcolor} % Added for using xcolor options
\usepackage{hyperref}

\newcommand{\Textfield}[3]{\TextField[name=#1,charsize=8pt,bordercolor={black},height=12pt,width=3cm,value=#2]{#3}} 

\setlength{\arrayrulewidth}{1.1pt} % thicken the table line

\begin{document}
\begin{Form}
  \begin{tabular}{|l@{}|}
     \hline
     \Textfield{textfield}{default}{Text}\\
     \hline
  \end{tabular}
\end{Form}
\end{document}
Still another approach is to set the border color to white, decrease the pdflinkmargin, and add columns to your table.

Code: Select all

\documentclass{article}
\usepackage{hyperref}
\hypersetup{pdflinkmargin=-0.5pt}

\newcommand{\Textfield}[3]{\TextField[name=#1,charsize=8pt,bordercolor={1 1 1},height=12pt,width=3cm,value=#2]{#3}}

\begin{document}
\begin{Form}
  \begin{tabular}{|l|l@{}|}
     \hline
     Text & \Textfield{textfield}{default}{}\\
     \hline
  \end{tabular}
\end{Form}
\end{document}
hpesoj626
Post Reply