Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6740131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:34:10+00:00 2026-05-26T11:34:10+00:00

I have used <div align=center> and put the image inside the div tag. Well

  • 0

I have used <div align="center"> and put the image inside the div tag. Well the image is at the center but not at the middle. The image started from the top of div tag and placing at the center but I want it to be placed at the middle not at the top.

When I googled it I found <td valign="middle">. and its working as I intended and below is what I have designed after googling,

  <div align="center" style="width:510px;height:510px;margin-left:300px">
  <table style="width:510px;height:510px">
  <tr>
  <td align="center" valign="middle">
  <img id="main" src="dock.jpg" style="max-width:500px;max-height:500px"/> 
  </td>
  </tr>
  </table>
  </div>

But using a table for these purpose is it harmful ? Because I have tried <div align="center" style="vertical-align:middle"> but does not seem to work as i expected and please let me know if there is a way to do without table ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:34:10+00:00Added an answer on May 26, 2026 at 11:34 am

    You shouldn’t be using <div align="center"> either really, its been deprecated:

    http://reference.sitepoint.com/html/div/align

    This attribute is deprecated. The correct method for aligning a div is
    to use the CSS text-align attribute.

    I’m not certain on the best way of vertically aligning div‘s (although you may find this article worth reading), but I know that you are right, you shouldn’t use tables as a solution. Table should only be used when creating a table of data results for example, never layout purposes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have not really used JavaScript before but I am trying to validate form
Have a Navbar <div> , inside is a <ul> and each <li> contains a
So I have an element that is placed directly inside body: <body> <div id=header>Some
I have the following: CSS: .photo { overflow: hidden; display: table-cell; vertical-align: middle; text-align:
I have a div with a child div inside it. I'm using jQuery to
I have the code below which is a div used for naviagtion its placed
I have an issue with some HTML displayed in Drupal, but I am not
I have used traditional version control systems to maintain source code repositories on past
I have used IPC in Win32 code a while ago - critical sections, events,
I have used the XML Parser before, and even though it worked OK, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.