Solved

How do I get automatic centering webpage on different monitors?

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

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now