Solved

Center Web Page in Browser - with Tables

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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASP.net Have sliders change in order 2 23
How to make a GridView cell hyperlinked using C# ? 3 35
imap mails 1 23
C# LINQ ForEach() question 6 28
I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

803 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