Solved

How do I get automatic centering webpage on different monitors?

Posted on 2015-01-22
1
116 Views
Last Modified: 2015-01-24
What html code will center a table on any monitor?
0
Comment
Question by:whwoodside
1 Comment
 
LVL 14

Accepted Solution

by:
Edwin Hoffer earned 500 total points
ID: 40565794
Hello whwoodside,

To show table in center on any monitor, the define the width to the "id", and make margin-left and margin-right "auto".

Here is an example for you:

<html>
<head>
<style>
.body {border: 0px;
	margin: 0px;
	padding: 0px;}
#table {width:1000px;margin-left:auto;margin-right:auto;}
</style>
</head>
<body>
<div id="table">
<table style="width:100%">
  <tr>
    <td>Jill</td>
    <td>Smith</td> 
    <td>50</td>
  </tr>
  <tr>
    <td>Eve</td>
    <td>Jackson</td> 
    <td>94</td>
  </tr>
</table>
</div>
</body>
</html>

Open in new window


Thanks
Edwin
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ClickOnce Install - Shortcut Question 3 72
strDist challenge 35 97
Arduino EDI - Programming language 3 80
Beginner to Unreal Engine 4 5 60
This is an explanation of a simple data model to help parse a JSON feed
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now