Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Textarea taking up more space than input, but has same Style?

Status
Not open for further replies.

jsteph

Technical User
Oct 24, 2002
2,562
US
Hi all,
I have an html table where each <td> has an <input> text field.

Now I've replaced the input in just one of the columns with a textarea. For the textarea I put the identical style on the textarea as the input had--no padding, no borders, etc, and forced the font-size and height of the element to 11px and 15px--same as I'd done for the input element styles. The only change to style was I made Overflow:Hidden so I wouldn't get scrollbars.

Yet now the actual run-time height of each row in the table is a few pixels higher, and I can now see spacing around the outside of the embedded inputs as well as the textarea. So somehow the behavior of the td changes when it contains a textarea as opposed to it containing a text-type input. There is no style on the td--it has always followed the height of the embedded input. How can I fix this so my table looks identical?
Thanks,
--Jim


 
Can you provide your HTML and CSS code or a URL to it? We have no idea of the DOCTYPE you are using, nor which browser(s) you have the problem with.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Hi Dan,
I'm putting together some sample code...it's only available on our intranet.

However the browser is ie7, and the doctype is:
doctype HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"

Since there's a huge amount of script involved, etc, I'm stripping that out and just trying to get two simple html table examples--but of course as I do this the problem does not reproduce (!). When I get it to behave I'll post it...but in doing so I may just stumble upon what's causing this...
Thanks,
--Jim

 
That DOCTYPE is incomplete, and therefore potentially invalid, putting browsers into 'quirks mode' instead of 'standards-compliant mode'.

See here for a list of valid and complete DOCTYPEs:


Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top