Solved

How do I get automatic centering webpage on different monitors?

Posted on 2015-01-22
1
123 Views
Last Modified: 2015-01-24
What html code will center a table on any monitor?
0
Comment
Question by:whwoodside
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
A short article about a problem I had getting the GPS LocationListener working.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

733 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