Solved

Center Web Page in Browser - with Tables

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

726 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