Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How do I get automatic centering webpage on different monitors?

Posted on 2015-01-22
1
Medium Priority
?
135 Views
Last Modified: 2015-01-24
What html code will center a table on any monitor?
0
Comment
Question by:Woody Woodside
[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 15

Accepted Solution

by:
Edwin Hoffer earned 2000 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

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
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 …
Progress

609 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