aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Force text box to the TD width Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Force text box to the TD width" Watch "Force text box to the TD width" New topic
Author

Force text box to the TD width

Sharon whipple
Ranch Hand

Joined: Jul 31, 2003
Posts: 294
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 :
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1164
Please try -



William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Sharon whipple
Ranch Hand

Joined: Jul 31, 2003
Posts: 294
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
stef li
Greenhorn

Joined: Jan 16, 2006
Posts: 27
i think there is no way to do it


This guy is so lazy!!!<br />There is nothing left!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Force text box to the TD width
 
Similar Threads
Input row select on data table does not get called
Getting "not a multipart request" even though the image is being saved.
controls:table in jsp
Problem with java layout and panels and containers
Add CheckBox Dynamically from child window to Parent Window