Show table at div top 100 left 100 position

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yogarajan
    New Member
    • Apr 2007
    • 115

    Show table at div top 100 left 100 position

    Hi All

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
     <HEAD>
      <TITLE> New Document </TITLE>
     
     </HEAD>
     <style type="text/css">
    #map {
        height:500px;
        width:800px;
        border:#999 solid 1px;
        /* background-image:url("test_map.jpg");*/ /*replace name with your image*/
        background-repeat:no-repeat;
    }
    </style>
    <script type="text/javascript">
    window.onload = function() {
        document.getElementById("map").style.backgroundPosition="100px 100px";
    }
    </script>
     <BODY>
    
      <div id ="map" class="drag">
      <table>
    	<tr><td>First Image</td><td>second image</td></tr>
    	<tr><td>Third Image</td><td>fourth image</td></tr>
    	<tr><td>fifth Image</td><td>sixth image</td></tr>
      </table>
      </div>
     </BODY>
    </HTML>
    my table should be show in div tag at particular position

    this is my code

    this is not working. Currently my table show at top of the div. but my requirement is my table show at div top 100 left 100 position

    pls guide me
  • veenna
    New Member
    • Dec 2007
    • 65

    #2
    try to use style for your <div>

    style=" left: 100px; top: 100px;"


    thanks
    veenna

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      More a CSS problem - moved to HTML/CSS forum.

      Set the top/left properties for the table, not the div and position it relatively.

      Comment

      • yogarajan
        New Member
        • Apr 2007
        • 115

        #4
        css problem

        Code:
        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
        <HTML>
         <HEAD>
          <TITLE> New Document </TITLE>
         
         </HEAD>
         <style type="text/css">
        #map {
            height:500px;
            width:800px;
            border:#999 solid 1px;
            /* background-image:url("test_map.jpg");*/ /*replace name with your image*/
            background-repeat:no-repeat;
        }
        </style>
        <script type="text/javascript">
        window.onload = function() {
            document.getElementById("map").style.backgroundPosition="100px 100px";
        }
        </script>
         <BODY>
         
          <div id ="map" class="drag">
          <table>
            <tr><td>First Image</td><td>second image</td></tr>
            <tr><td>Third Image</td><td>fourth image</td></tr>
            <tr><td>fifth Image</td><td>sixth image</td></tr>
          </table>
          </div>
         </BODY>
        </HTML>

        my table should be show in div tag at particular position

        this is my code

        this is not working. Currently my table show at top of the div. but my requirement is my table show at div top 100 left 100 position

        pls guide me

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          Threads merged. Your thread had already been moved here. There was no need to start another one. Have you tried what I suggested in post #3?

          Comment

          • yogarajan
            New Member
            • Apr 2007
            • 115

            #6
            Hi

            pls give some samples

            Comment

            • acoder
              Recognized Expert MVP
              • Nov 2006
              • 16032

              #7
              It's quite self-explanatory:
              Code:
              #map table {
                  top: 100px;
                  left: 100px;
                  position:relative;
              }

              Comment

              Working...