Solved

How to align a button inside a table cell!

Posted on 2006-10-30
5
713 Views
Last Modified: 2008-02-07
This button will not align to the center of the td cell. It always stays at the to of the cell, which looks bad because the other cells end up below.

I've tried everyting I can think of to center the button inside the table but so far nothing works. If I have to use a style, I'd rather do so on the input line instead of css. But if not, then I'm open to ideas. This must be simple, but not for me.

<table border="1" align="center">
  <tr>
    <td align="center" valign="middle">
   <form name="form1" action="page1.cfm" method="post">
      <div align="center">
         <input type="submit" value="ShowPage1">
      </div>
   </form>
   </td>
   <td>
     Text in table td cell goes here.
   </td>
   <td>
     <img src="image.giv">
   </td>
  </tr>
</table>

 - Georgia
0
Comment
Question by:RollinNow
  • 2
  • 2
5 Comments
 
LVL 30

Accepted Solution

by:
Steggs earned 500 total points
ID: 17838599
Greetings RollinNow,

<table border="1" style="margin:0 auto;height:100px;">
  <tr>
    <td>
<form name="form1" action="page1.cfm" method="post" style="display:inline;">
<input type="submit" value="ShowPage1">
</form>
   </td>
   <td>
     Text in table td cell goes here.
   </td>
   <td>
     <img src="image.giv">
   </td>
  </tr>
</table>

Regards
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 17838624
RollinNow,

What do you mean it isn't centered?  Do you mean vertically, horizontally or both?  Is that the same code you used because it appears to center vertically and horizontally in both IE and FF?  Please elaborate on the problem.

Let me know if you have any questions or need more information.

b0lsc0tt
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 17838632
I did not see Stegg's comment so hopefully it fixes your problem.  Let us know if it doesn't.
0
 

Author Comment

by:RollinNow
ID: 17838641
You nailed it. Thanks for beautifying lots of websites and tons of pages.

I increased the points to 500.

  - Georgia
0
 
LVL 30

Expert Comment

by:Steggs
ID: 17838647
Your welcome, thanks for the A :)
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now