LaTeX forum ⇒ Graphics, Figures & TablesDistance between cell content and boarder Topic is solved

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

Distance between cell content and boarder

Postby loro » Mon Sep 14, 2015 2:22 pm

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:
  1. \documentclass[12pt,a4paper]{article} % Use A4 paper with a 12pt font size - different
  2. \usepackage[left=0.1cm,right=1.0cm,top=1.8cm,bottom=3.0cm,marginparwidth=3.4cm]{geometry} % Adjust page margins
  3. \usepackage[colorlinks=true, pdfborder={0 0 0}, hidelinks]{hyperref} % this is needed for forms and links within the text
  4. \usepackage{tabularx} %Required for table
  5. \usepackage{fixltx2e}
  6.  
  7.  
  8. \newcommand{\bcolor}{0.9 0.2 0.3} %bordercolor
  9. \newcommand{\bwidth}{0.3pt} %borderwith
  10. \newcommand{\underlineLength}{4}
  11. \newcommand{\tfc}{35mm}
  12. \newcommand{\tfw}{8mm}
  13. \newcommand{\TableTextField}[2][]{\TextField[#1, borderwidth=\bwidth, bordercolor=\bcolor,width=\tfc, borderstyle=U]{#2}}
  14.  
  15.  
  16.  
  17.  
  18. \begin{document}
  19. \begin{Form}
  20. \begin{tabular*}{\textwidth}{|l@{\extracolsep{\fill}}ll|lll|}\hline
  21. INFO1& \TableTextField[name=IN]{}&Hz&
  22. INFO2&\TableTextField[name=Nennstrom]{}&Hz\\\hline
  23. %
  24. INFO3&\TableTextField[name=MNH]{}&Hz&
  25. INFO4&\TableTextField[name=Gf]{}&Hz\\\hline %
  26. \end{tabular*}
  27. \end{Form}
  28. \end{document}
Last edited by Stefan Kottwitz on Mon Sep 14, 2015 4:07 pm, edited 1 time in total.
Reason: inline code changed to code block

Tags:

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

Postby loro » Thu Sep 24, 2015 9:17 am

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.


  1. \documentclass[12pt,a4paper]{article} % Use A4 paper with a 12pt font size - different
  2. \usepackage[left=0.1cm,right=1.0cm,top=1.8cm,bottom=3.0cm,marginparwidth=3.4cm]{geometry} % Adjust page margins
  3. \usepackage[colorlinks=true, pdfborder={0 0 0}, hidelinks]{hyperref} % this is needed for forms and links within the text
  4. \usepackage{tabularx} %Required for table
  5. \usepackage{fixltx2e}
  6.  
  7.  
  8. \newcommand{\bcolor}{0.9 0.2 0.3} %bordercolor
  9. \newcommand{\bwidth}{0.3pt} %borderwith
  10. \newcommand{\underlineLength}{4}
  11. \newcommand{\tfc}{35mm}
  12. \newcommand{\tfw}{8mm}
  13. \newcommand{\TableTextField}[2][]{\TextField[#1, borderwidth=\bwidth, bordercolor=\bcolor,width=\tfc, borderstyle=U]{#2}}
  14.  
  15.  
  16.  
  17.  
  18. \begin{document}
  19. \begin{Form}
  20. \begin{tabular*}{\textwidth}{l@{\extracolsep{\fill}}lllll}%\hline
  21. \\*[-1.05em] INFO1& \TableTextField[name=IN]{}&Hz&
  22. INFO2&\TableTextField[name=Nennstrom]{}&Hz\\%\hline
  23. %
  24. \\*[-1.05em] INFO3&\TableTextField[name=MNH]{}&Hz&
  25. INFO4&\TableTextField[name=Gf]{}&Hz\\%\hline %
  26. \end{tabular*}
  27. \end{Form}
  28. \end{document}


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 6 guests