Solved

align HTML table in chrome...

Posted on 2013-06-12
14
252 Views
Last Modified: 2013-06-16
Hi, I am using the following script to align my table and it does not seem to work in Chrome, it works in FF. Can someone let me know what I can do to have it work in chrome?

div#wrapper {
        display:table;
        position:static;
        margin-top: 60px;
        left:60px;
        }


<body>
<div id="wrapper">
<table width="70%" border="0" cellspacing="4" cellpadding="4" class="table">
  <tr class="heading">
    ......


What I am trying to achieve is to have my table positioned 60px from the left side.

Thank you
0
Comment
Question by:aej1973
  • 7
  • 4
  • 3
14 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
Comment Utility
You should be using position:relative instead of position:static

Cd&
0
 

Author Comment

by:aej1973
Comment Utility
Tried that but it did now work;

div#wrapper {
        display:table;
        position:relative;
        margin-top: 60px;
        padding-left:60px;
        }
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
Comment Utility
Then post a link to the page so I can see what is going on. A fragment of code does not tell me much.

Cd&
0
 

Author Comment

by:aej1973
Comment Utility
Hi cd, I have attached my html file and my css file, thank you.

A
InvStyle.css
home.txt
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
Comment Utility
Well the code is pretty much worthless.  The CSS does not validate using http://jigsaw.w3.org/css-validator/

The HTML is a disaster.  It is no where near being well formed and valid.  It contains multiple doctype and html tags and is junk based on the results from http://validator.w3.org/

It is a wonder the browser displays anything more than a blank page.  There is no sense in trying to solve a rendering problem when the code is so defective.  So the forst thing you need to do is use the validators to get something that resembles valid code, then if there is still a problem it will be solvable.

Cd&
0
 
LVL 58

Expert Comment

by:Gary
Comment Utility
Did you join 3 pages together?

Works fine for me in Chrome, though you do have your body margin which you can get rid of with
body {
margin:0;
padding:0;
}

http://jsfiddle.net/g5XpU/
0
 

Author Comment

by:aej1973
Comment Utility
I guess, I should have stripped out the header, there were two pages joined together. Attached is a screen shot of the page. All I am trying to do is to move the table left, 60px from the left edge, thanks.

A
home.png
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 58

Expert Comment

by:Gary
Comment Utility
Attach your real html code.
0
 

Author Comment

by:aej1973
Comment Utility
I apologize regarding my previous attachment, I had copied the source code from view source and I guess it had a lot of unnecessary information.
 
<?php
include 'header_main.php';
include 'footer.html';
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/InvStyle.css" />
</head>
<body> 
<div id="wrapper">   
<table width="70%" border="0" cellspacing="4" cellpadding="4" class="table">
  <tr class="heading">
    <th colspan="3">System Information</th>
  </tr>
  <tr>
    <th class="homePage">Total Extensions</th>
    <th class="homePage">Join Date</th>
    <th class="homePage">Registered Phones Lines</th>
  </tr>
  <tr>
    <td class="homePageInfo"><?=$count?></td>
    <td class="homePageInfo"><?=$joinDate?></td>
    <td class="homePageInfo"><?=$rowCount?></td>
  </tr>
  <tr>
    <th class="homePage">Last Login date/time</th>
    <th class="homePage">Last Login IP</th>
    <th class="homePage">Current IP</th>   
  </tr>
  <tr>
   <td class="homePageInfo3"><?=$lastDt?></td>
    <td class="homePageInfo3"><?=$lastIp?></td>
    <td class="homePageInfo3"><?=$ipaddress?></td>
  </tr>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
     </div>
   </body>
</html>

Open in new window

0
 
LVL 58

Accepted Solution

by:
Gary earned 250 total points
Comment Utility
Code works fine for me

http://jsfiddle.net/RsCqU/
0
 

Author Comment

by:aej1973
Comment Utility
Chrome? It worked for me in FF.
0
 

Author Comment

by:aej1973
Comment Utility
well I checked, jsfiddle in Chrome too and it worked. Thank you.
0
 
LVL 58

Expert Comment

by:Gary
Comment Utility
Does the fiddle work in Chrome? It does for me - 60px from the left even as you resize the window.
View the source of your page in Chrome and attach the code here or better still give a link if it is online.
0
 

Author Closing Comment

by:aej1973
Comment Utility
Thank you.
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

Suggested Solutions

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

771 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

7 Experts available now in Live!

Get 1:1 Help Now