By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,732 Members | 843 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,732 IT Pros & Developers. It's quick & easy.

Why align="center" doesn't center content in table?

mickey0
100+
P: 142
Hello, I would like to center 'Savi' but align=center seems dont' work on it. Any hints? thanks
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body>
  3. <table border="1">
  4.    <tr>
  5.     <th align="center">Savi</th>
  6.    </tr>
  7.   <tr>
  8.     <td>January</td>
  9.     <td>$100000000000</td>
  10.   </tr>
  11. </table>
  12. </body>
  13. </html>
  14.  
Jul 13 '10 #1
Share this Question
Share on Google+
1 Reply


TheServant
Expert 100+
P: 1,168
You have one column for the first row and two columns for the second. Change it to:
Expand|Select|Wrap|Line Numbers
  1. <html>
  2.     <body>
  3.         <table border="1">
  4.             <tr>
  5.                 <th align="center" colspan="2">Savi</th>
  6.             </tr>
  7.             <tr>
  8.                 <td>January</td>
  9.                 <td>$100000000000</td>
  10.             </tr>
  11.     </table>
  12.     </body>
  13. </html>
Jul 13 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.