Solved

Center Web Page in Browser - with Tables

Posted on 2012-03-12
3
243 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

839 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