Results 1 to 7 of 7

Thread: [Resolved] HTML: INPUT field resizes to size of text?

  1. #1

    Thread Starter
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256

    [Resolved] HTML: INPUT field resizes to size of text?

    My problem lies in code like this:

    Code:
    <table border="1" style="width: 45%;">
        <tr>
            <td style="width: 30%;">Your Name :</td>
            <td style="width: 70%;">
                <input type="text" name="textbox" value="[long text here]" style="width: 100%;">
            </td>
        </tr>
    </table>
    Rather than fitting to the 70%, the input field will make itself the entire width of the text. How can I make it just size to the 70%?
    Last edited by The Hobo; Jul 1st, 2003 at 01:30 PM.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  2. #2

    Thread Starter
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Anyone?
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: HTML: INPUT field resizes to size of text?

    Originally posted by The Hobo

    Rather than fitting to the 70%, the input field will make itself the entire width of the text. How can I make it just size to the 70%?
    I checked your code, but that's not what I'm getting. The input field is the entire width of the td here.

    Could it be a browser problem?

    Windows XP/IE6 here.

  4. #4

    Thread Starter
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    I've tried it in both IE5.5 and IE6 and I get the same results.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Post a snapshot, or if possible link to the page.

  6. #6

    Thread Starter
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Did you replace "[long text here]" with some really, really long text?

    The problem only occurs when the amount of text exceeds that which can be displayed by the size of the box. When that happens, the box, for some reason, expands to display ALL of the text.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  7. #7

    Thread Starter
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Code:
    <table border="1" style="table-layout: fixed; width: 45%;">
        <tr>
            <td style="width: 30%;">Your Name :</td>
            <td style="width: 70%;">
                <input type="text" name="textbox" value="[long text here]" style="width: 100%;">
            </td>
        </tr>
    </table>
    Adding table-layout: fixed; corrected the problem.
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width