Jump to content

Forms And Spacing


nuzerog
 Share

Recommended Posts

I have a search box embedded into a cell of a table. <td><form name="search" action="../search-post.asp" method="post"><br/><input type="text" name="searchString" size="25"/> <a href="java script:document.search.submit();"><font color=green face="arial,helvetica,verdana" size=2>Search</font></a></form></td>Is there a way to control the height of the cell with a form and make it as narrow as possible? Thanks MuchHKIM

Link to comment
Share on other sites

I have a search box embedded into a cell of a table. <td><form name="search" action="../search-post.asp" method="post"><br/><input type="text" name="searchString" size="25"/> <a href="java script:document.search.submit();"><font color=green face="arial,helvetica,verdana" size=2>Search</font></a></form></td>Is there a way to control the height of the cell with a form and make it as narrow as possible? Thanks MuchHKIM
Yes there is. You can use the style attribute of the input tag like this:
<input type="text" name="searchString" size="25" style='height: 15px;'/>

*EditSorry, that should be on the <td> tag:

<td style='height: 15px;'/>

But you will probably still have to change the input if you want the cell to shrink, because the cell will only go as small as the largest element in it.

Edited by jkloth
Link to comment
Share on other sites

icon8.gif If you really want to do this right, you will modernize your code. Drop the <font> tag for one. You can put that information in a CSS sheet. This can be external or in the <head> section of your document. This page links to lots of examples: http://www.w3schools.com/css/css_reference.aspIt is also generally bad practice to put style attributes in content tags. That information can also come in your style sheet. (There is a place for style attributes, but some authors overuse them, making their pages very hard to maintain. One purpose of style sheets is to simplify.)And if you try really hard, you can find a way to do all of this without using a table at all. Since you're obviously not used to using CSS, that might be a goal for the future.Good luck. Edited by Deirdre's Dad
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...