PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, November 18, 2022

[FIXED] How to vertical align a table inside a div

 November 18, 2022     css, html, html-table, vertical-alignment     No comments   

Issue

I have a background div with set dimensions, which includes a table element.

I'm looking for a way to position the table in the middle-left of the div. Left is easy, middle I can't get to work. This is what I have:

HTML

 <div id="background">
      <table>
        //... stuff 
      </table>
 </div>

CSS:

 #background {
      height: 1000px;
      width: 1000px;
      text-align: left;
      }

Can someone tell me how to vertical align the table?


Solution

Div's don't allow vertical aligns typically. The only option would be to make it act like a table cell or do something like margin/padding that will look like your table is vertically aligned.



Answered By - Tyler
Answer Checked By - Cary Denson (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing