• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Force text box to the TD width

 
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all
I have simple Html table, table cells are html text box (input type=text)
The text box won't inherit his father (TD) width, as a result the table is to width and I get horizontal scroll.
I tried style="text-overflow:hidden;" on the input without success.

Because the amount of columns on the table is dynamic, and screen resolution may vary, I am unable to calculate the amount of pixels.

But I can compute the width of each column according to the number of columns (100% / number of columns) = width of each column.

Is there any way I can force the text box to inherit its column width?

Thank you
Sharon

in the example each col is 5% but long text in the text box, make the table go out of the 100% bound.
Html example :
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please try -

 
Sharon whipple
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you
I tried this style before, it force's the table to fit the container width,
But it make's the text box act wired (try navigating in the text using the arrows)
Thanks again
Sharon
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i think there is no way to do it
 
reply
    Bookmark Topic Watch Topic
  • New Topic