Graphics, Figures & TablesDistance between cell content and boarder

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
loro
Posts: 5
Joined: Wed Sep 09, 2015 10:44 pm

Distance between cell content and boarder

Post by loro »

Hi at all,
I try to make an interactive pdf Formular. So I create a table which contains some TextFields with a colored boarder. The TextFields only should have Unterlines, so I add the option "border style=U". But The text fields overlap and the underneath text field covers the underscore from the above Field.
How can I add some space between the cell Content?

This is my mini-page example:

Code: Select all

\documentclass[12pt,a4paper]{article} % Use A4 paper with a 12pt font size - different
\usepackage[left=0.1cm,right=1.0cm,top=1.8cm,bottom=3.0cm,marginparwidth=3.4cm]{geometry} % Adjust page margins
\usepackage[colorlinks=true, pdfborder={0 0 0}, hidelinks]{hyperref} % this is needed for forms and links within the text
\usepackage{tabularx} %Required for table 
\usepackage{fixltx2e}


\newcommand{\bcolor}{0.9 0.2 0.3} %bordercolor 
\newcommand{\bwidth}{0.3pt} %borderwith
\newcommand{\underlineLength}{4}
\newcommand{\tfc}{35mm}
\newcommand{\tfw}{8mm}
\newcommand{\TableTextField}[2][]{\TextField[#1, borderwidth=\bwidth, bordercolor=\bcolor,width=\tfc, borderstyle=U]{#2}}




\begin{document}
\begin{Form}
  \begin{tabular*}{\textwidth}{|l@{\extracolsep{\fill}}ll|lll|}\hline
    INFO1& \TableTextField[name=IN]{}&Hz&
    INFO2&\TableTextField[name=Nennstrom]{}&Hz\\\hline
    %
    INFO3&\TableTextField[name=MNH]{}&Hz&
    INFO4&\TableTextField[name=Gf]{}&Hz\\\hline %
  \end{tabular*}
\end{Form}
\end{document}
Last edited by Stefan Kottwitz on Mon Sep 14, 2015 4:07 pm, edited 1 time in total.

Recommended reading 2024:

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

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

loro
Posts: 5
Joined: Wed Sep 09, 2015 10:44 pm

Distance between cell content and boarder

Post by loro »

Have Found a Solution,
I add a \\*[-1.05em] at the beginning of every table row for a vertical space and remove the tabel border.

Code: Select all

\documentclass[12pt,a4paper]{article} % Use A4 paper with a 12pt font size - different
\usepackage[left=0.1cm,right=1.0cm,top=1.8cm,bottom=3.0cm,marginparwidth=3.4cm]{geometry} % Adjust page margins
\usepackage[colorlinks=true, pdfborder={0 0 0}, hidelinks]{hyperref} % this is needed for forms and links within the text
\usepackage{tabularx} %Required for table 
\usepackage{fixltx2e}


\newcommand{\bcolor}{0.9 0.2 0.3} %bordercolor 
\newcommand{\bwidth}{0.3pt} %borderwith
\newcommand{\underlineLength}{4}
\newcommand{\tfc}{35mm}
\newcommand{\tfw}{8mm}
\newcommand{\TableTextField}[2][]{\TextField[#1, borderwidth=\bwidth, bordercolor=\bcolor,width=\tfc, borderstyle=U]{#2}}




\begin{document}
\begin{Form}
  \begin{tabular*}{\textwidth}{l@{\extracolsep{\fill}}lllll}%\hline
    \\*[-1.05em] INFO1& \TableTextField[name=IN]{}&Hz&
                 INFO2&\TableTextField[name=Nennstrom]{}&Hz\\%\hline
    %
    \\*[-1.05em] INFO3&\TableTextField[name=MNH]{}&Hz&
                 INFO4&\TableTextField[name=Gf]{}&Hz\\%\hline %
  \end{tabular*}
\end{Form}
\end{document}
Post Reply