nitin_gj nitin_gj - 15 days ago 7
CSS Question

Align table cell to center

Below is my table coding. I want to align the last (logout) to the center of table. It aligns to the left and I want it to be center

<table width="50%" border="0">
<tr>
<td><div align="center"><a href="viewjobseeker.php"><img src="\Proj main\images\Edu.png" alt="" width="64" height="64" /></div></td></a>
<td><div align="center"><a href="viewemployer.php"><img src="\Proj main\images\Profile.png" alt="" width="64" height="64" /></div></td></a>
<td><div align="center"><a href="viewjob.php"><img src="\Proj main\images\jobopening.jpg" alt="" width="64" height="64" /></div></td></a>
</tr>
<tr>
<td bgcolor="#A0B9F3"><div align="center"><a href="viewjobseeker.php"><strong>View JobSeeker Profile</strong></a></div></td>
<td bgcolor="#A0B9F3"><div align="center"><a href="viewemployer.php"><strong>View Employer Porfile</strong></a></div></td>
<td bgcolor="#A0B9F3"><div align="center"><a href="viewjob.php"><strong>View Job Opening</strong></a></div></td>
</tr>
<tr>
<td><div align="center"><a href="editjobseekeradmin.php"><img src="\Proj main\images\edit.png" alt="" width="64" height="64" /></div></td></a>
<td><div align="center"><a href="editemployeradmin.php"><img src="\Proj main\images\editemployer.png" alt="" width="64" height="64" /></div></td></a>
<td><div align="center"><a href="checkfeedbackadmin.php"><img src="\Proj main\images\Feedback.png" alt="" width="64" height="64" /></div></td></a>
</tr>
<tr>
<td bgcolor="#A0B9F3"><div align="center"><a href="editjobseekeradmin.php"><strong>Edit JobSeeker Profile</strong></a></td>
<td bgcolor="#A0B9F3"><div align="center"><a href="editemployeradmin.php"><strong>Edit Employer Profile</strong></a></div></td>
<td bgcolor="#A0B9F3"><div align="center"><a href="checkfeedbackadmin.php"><strong>Check feedback</strong></a></div></td>

</tr><div id="center1">
<tr align="center">
<center>
<td align="center"><div align="center"><a href="logoutadmin.php"><img src="\Proj main\images\Log.png" alt="" width="64" height="64" /></div></td></tr></a>
<tr align="center">
<td bgcolor="#A0B9F3" align="center"><div align="center"><a href="logoutadmin.php"><strong>Logout</strong></a></div></td>
</tr></div></center>
</table>


This is the table screenshot:

Answer

Look at this link, is that what you meant?

What I did was to clean all the unneeded divs and add a empty td on each side of the full td in the last two rows.

    <tr align="center">
    <td></td>
    <td text-align="center">
        <div align="center">
            <a href="logoutadmin.php"><img src="\Proj main\images\Log.png" alt="" width="64" height="64" /> </a></div>
    </td>
    <td></td>
</tr>

<tr align="center">
    <td></td>
    <td bgcolor="#A0B9F3" align="center">
        <div align="center"><a href="logoutadmin.php"><strong>Logout</strong></a></div>
    </td>
    <td></td>
</tr>