Solved

How to align a button inside a table cell!

Posted on 2006-10-30
5
738 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Create an automated page index 9 110
transfer content to new site design 7 49
regular gmail; not g-suite. one label. 11 50
Developers / Staff Setup 10 48
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will learn how to count occurrences of each item in an array.

752 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