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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mickey0
    New Member
    • Jan 2008
    • 142

    #1

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

    Hello, I would like to center 'Savi' but align=center seems dont' work on it. Any hints? thanks
    Code:
    <html>
    <body>
    <table border="1">
       <tr>
        <th align="center">Savi</th>
       </tr>
      <tr>
        <td>January</td>
        <td>$100000000000</td>
      </tr>
    </table>
    </body>
    </html>
  • TheServant
    Recognized Expert Top Contributor
    • Feb 2008
    • 1168

    #2
    You have one column for the first row and two columns for the second. Change it to:
    Code:
    <html>
    	<body>
    		<table border="1">
    			<tr>
    				<th align="center" colspan="2">Savi</th>
    			</tr>
    			<tr>
    				<td>January</td>
    				<td>$100000000000</td>
    			</tr>
    	</table>
    	</body>
    </html>

    Comment

    Working...