TransWikia.com

How to automatically adjust textfields height to fill in a table cell?

TeX - LaTeX Asked by K S on February 8, 2021

I am making a document in which I am using a lot of tables which are using checkboxes and textfields.

Both are working fine only one issue I have and that is the automatic adjustment of the textfields height base on the text in other column of the table.

below I give an example of what I have developed.

    {scriptsize{
    begin{flushleft}
    {setlength{tabcolsep}{0.25pc}
    setlengthLTleft{0cm}
    begin{longtable}[H]{!{color{bleudefrance}vrule}P{1.1cm}!{color{bleudefrance}vrule}p{9.1cm}!{color{bleudefrance}vrule}c!{color{bleudefrance}vrule}c!{color{bleudefrance}vrule}c!{color{bleudefrance}vrule}p{3.2cm}!{color{bleudefrance}vrule}} 
    
     caption[MyCaption]{footnotesize{ textit{MyCaptionhfillmbox{}}}}
    arrayrulecolor{bleudefrance}
    hline rowcolor{bleudefrance}
      & & multicolumn{3}{!{color{bleudefrance}vrule}c!{color{bleudefrance}vrule}}{color{white} Result} &  \  cline{3-5}    %hhline{--~~~-}
     rowcolor{bleudefrance} 
    multirow{-2}{*}{color{white} No.}    &   multirow{-2}{*}{color{white} Checks}            & cellcolor{bleudefrance} {color{white}V}      & {color{white}X}     &  {color{white}-}       &     multirow{-2}{*}{color{white} Note}\ hline
    endfirsthead
    
    multicolumn{3}{c}%
    {footnotesize{{textit{tablename thetable{} -- footnotesize{MyCaptionhfillmbox{}}}}}} \
    hline rowcolor{bleudefrance}   & & multicolumn{3}{!{color{bleudefrance}vrule}c!{color{bleudefrance}vrule}}{color{white} Result} &  \  cline{3-5}    %hhline{--~~~-}
     rowcolor{bleudefrance} 
    multirow{-2}{*}{color{white} No.}    &   multirow{-2}{*}{color{white} Checks}            & cellcolor{bleudefrance} {color{white}V}      & {color{white}X}     &  {color{white}-}       &     multirow{-2}{*}{color{white} Note}\ hline
    endhead
    hline multicolumn{6}{!{color{bleudefrance}vrule}r!{color{bleudefrance}vrule}}{{Continued on next page}} \ hline
    endfoot
    
    hline 
    endlastfoot
    
   1.2.3   & parbox{9cm}{vspace{0.15cm} blindtext
     vspace{0.2cm}} &   myCheckBox  &   myCheckBox  &  myCheckBox & myTableTextFieldm{4.7cm}[120pt][3.25cm]{}[l] 

end{longtable}}
end{flushleft}}}

The code for myTableTextFieldm is as below:

NewDocumentCommandmyTableTextFieldm{m O{tfh} O{tfw} m O{l}}{parbox{#1}{vspace{0.1cm} TextField[multiline, name==romannumeralfldn@me,charsize=tfcs,bordercolor=bcolor,height=#2,width=#3, default=#4, align=#5]{} globaladvancefldn@me1 vspace{0.1cm}}}

So in summary, my aim is to automatically adjust the height of the text field height (120pt above) in last column to the height of the parbox I have in the second column. Please let me know if you have a solution to this.

I have a lot of tables like this and if I can do this automatically instead of manually it would save me a lot of time.

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP