?
Solved

How do I get automatic centering webpage on different monitors?

Posted on 2015-01-22
1
Medium Priority
?
129 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Make the most of your online learning experience.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Six Sigma Control Plans

762 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