3 replies [Last post]
8mycsh
Offline
newbie
Last seen: 18 years 15 weeks ago
Joined: 2004-08-17
Posts: 2
Points: 0

I have a simple search form and search button in a table. I need the button to hug the bottom right corner while the search field stays on the center. Can I dop this using the alignment function or is that for text only?

The other way I can think of is create to cells in the table and just use the align right, bottom in the cell that holds the button.

indy_jones
indy_jones's picture
Offline
Regular
USA
Last seen: 18 years 15 weeks ago
USA
Timezone: GMT-5
Joined: 2004-08-16
Posts: 11
Points: 0

try this . . .

If you can, could you post the css and html you are using to create this? I'm going to go on what you said, however and give a solution that may or may not help you.

If the table's only purpose is to hold the search form, then you should scrap it and use three div tags instead. Make the first one a container to hold the other two which would in turn hold the form field and submit button. If you do it this way then you can position the div tags within the container any way you see fit. This allows you the most flexibility in you design and allows you to alter it quite easily if you change your mind down the road.

8mycsh
Offline
newbie
Last seen: 18 years 15 weeks ago
Joined: 2004-08-17
Posts: 2
Points: 0

Alignment

Here is the code within the table. Thanks for the help.

<td width="158" height="104" valign="top"><form action="index.php" method="post">
                        <div align="right">
                          <br><br><input class="inputbox" type="text" name="searchword" size="15" value="<?php echo _SEARCH_BOX; ?>"  onBlur="if(this.value=='') this.value='<?php echo _SEARCH_BOX; ?>';" onFocus="if(this.value=='<?php echo _SEARCH_BOX; ?>') this.value='';" />&nbsp;
                          <input type="image"  src="/templates/au_blue/images/buttons/search_button.gif" name="option" value="search" />&nbsp;
                        </div>
                      </form></td>

indy_jones
indy_jones's picture
Offline
Regular
USA
Last seen: 18 years 15 weeks ago
USA
Timezone: GMT-5
Joined: 2004-08-16
Posts: 11
Points: 0

see if this works

<head>
	<style type="text/css">
		#container{/*position this element so that it will align over or within your table*/
 		width:158px;
	 	height:104px;
	 	vertical-align:top
		}
	
		#text{/*make this as big as you want*/
		 position:absolute;
		 left:50%;
		 top:0px;
		}

		#button{/*make this as big as you want*/
	  	 position:absolute;
	 	 bottom:0px;
	 	 right:0px;
		}
	</style>
</head>
<body>
	<td width="158" height="104" valign="top">
		<div id="container">
			<form action="index.php" method="post">
				<div id="text">
         		<input class="inputbox" type="text" name="searchword" size="15" value="<?php echo _SEARCH_BOX; ?>"	onBlur="if(this.value=='') this.value='<?php echo _SEARCH_BOX; ?>';" onFocus="if(this.value=='<?php echo _SEARCH_BOX; ?>') this.value='';" />
				</div>
            <div id="button">
					<input type="image"  src="/templates/au_blue/images/buttons/search_button.gif" name="option" value="search" />
				</div>
			</form>	
		</div>
	</td>
</body>

This will allow you to position within your table. However, I would strongly recommend that you rebuild your layout using div tags and css. This will allow you much more flexibility. Hope this code solves your problem! Laughing out loud