?
Solved

Center Web Page in Browser - with Tables

Posted on 2012-03-12
3
Medium Priority
?
249 Views
Last Modified: 2012-03-13
OK...I need some help with this one!
I can get the stuff on the web page to center execpt the tables on the page.

The tables have set lenghts for columns so I can format things on the page.
For example...I have a table that one row each column have different widths (column 1 may be 200px, the next column 2 may be 800px) but ALL my tables on the page add up to a total width of 1000 no matter what the column widths may be.

I have a master page and I was hoping that I might that I could just put the <div "style=text-align: center"> and I would be good to go...execpt as I mentioned works fine for things that are NOT tables.

<body>
    <form id="form1" runat="server">
    <div style="width: 1000px;>
        <br />
        <table summary="" cellspacing="0" cellpadding="0" style="width: 1000px; height: 96px;">
        <tr>
            <td colspan="1" style="width: 385px; height: 76px;" align="left">
                <img alt='' src="Images/Background.gif" height="72px" width="360px"/>
            </td>
            <td colspan="2" style="width: 615px; height: 76px;" align="center">
                <font face="Tahoma" color="black" size="6"><b>Ticket Reporting</b></font><br />
                <font face="Tahoma" color="black" size="5"><b>Customer Care</b></font></td>
        </tr>
        </table>

Open in new window


I've attached a piece of the code as an example!

Thanks,
Mark
0
Comment
Question by:smithmrk
3 Comments
 
LVL 15

Assisted Solution

by:Ess Kay
Ess Kay earned 400 total points
ID: 37711760
are you trying to center the table itself or the text inside it


try using the center command

<center><table>...</table></center>
0
 
LVL 3

Accepted Solution

by:
MikeyLLB earned 1600 total points
ID: 37712263
The non-standards compliant way (may not work in newer browsers)
<table align="center">
    ...
</table>

Open in new window


If you are using CSS/Styling you can also use:
In the CSS file:
table.center {
    margin-left:auto; 
    margin-right:auto;
}

Open in new window

In the HTML:
<table class="center">
    ...
  </table>

Open in new window

0
 

Author Closing Comment

by:smithmrk
ID: 37714828
Thank you both for your quick responses.
This was driving me insane yesterday and I'm glad to finally put it behind me.

Mark
0

Featured Post

Industry Leaders: 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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

850 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