Solved

Center Web Page in Browser - with Tables

Posted on 2012-03-12
3
238 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 100 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 400 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

757 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

21 Experts available now in Live!

Get 1:1 Help Now