Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 7th, 2007, 01:34 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default Text Box too wide due to value?

This code:

<table id="tblTitleText" border="1">
 <tr>
  <td>
   <input name="txtName"
      type="text"
          value="Rons Test Lookup Fdfgdfgdfgdsfgsdfgsdfgdsfgdsfgsdf"
          maxlength="50"
          id="txtName"
          title="This text will appear at the top of your Form."
          style="width:100%;color:Black;font-family:Arial;font-size:300%;font-weight:Bold;font-style:Normal;text-decoration:normal;background-color:Tan;" />
   <br />
  </td>
 </tr>
</table>

...produces an input box that is WIDER than the screen, despite a 100% length in the style attribute. This results in a side-scroll bar in the browser. It appears that the length of the Imput box value is causing the miscalculation.

I want the text box to be exactly as wide as the TD and I don't want to specify a hard coded width because screen resolution might vary. What do I have to do to keep the table from exceeding the browser screen width, the way you'd normally expect width=100% to work?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Grab Values From List Box into Text Box phungleon VB How-To 2 June 19th, 2008 10:33 PM
Count in combo box(display results in text box) mboyisis Access 4 April 4th, 2008 07:08 AM
Extract text from text file & put in dropdown box tsukey Beginning PHP 5 July 20th, 2004 09:49 PM
Rich Text Box vs Text Box snowy0 VB.NET 2002/2003 Basics 1 February 17th, 2004 02:11 PM
Search using drop down list box and a text box tcasp Classic ASP Basics 1 July 31st, 2003 02:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.