Ask Experts Questions for FREE Help !
Ask
    sbware's Avatar
    sbware Posts: 1, Reputation: 1
    New Member
     
    #1

    Sep 5, 2007, 12:13 AM
    How to combine 2 tabels into one (column freezing)
    Hi all ,
    I am trying to freeze the columns of HTML table. Below is the code for the same. It works fine on Mozill and IE . However I want to make the use of a single table instead of two in the following code. Is it possible to do that. I mean to achieve the same functinality with the one table through out the entire code...
    Thanks in advance
    Samir


    <html>
    <head>
    <title>Some Title</title>
    <style>
    table {
    border-collapse : collapse;
    position : absolute;
    height : 100%;
    }

    td, th {
    background-color: #aaaaaa;
    border-right : 1px solid #ffffff;
    color : #ffffff;
    width : 100px;
    text-align : center;
    }

    td.locked_left, th.locked_left {
    background-color: #88ff88;
    font-weight : bold;
    border-left : 1px solid #ffffff;
    }

    #table_container_left {
    width : 190px;
    height : 113px;
    position : relative;
    float : left;
    overflow : hidden;
    }

    #table_container_right {
    width : 150px;
    height : 128px;
    overflow : scroll;
    float : left;
    position : relative;
    }

    </style>
    <script type="text/javascript">
    function initScroll() {
    var leftDiv = document.getElementById('table_container_left');
    var rightDiv = document.getElementById('table_container_right');
    rightDiv.onscroll = function() {
    leftDiv.scrollTop = this.scrollTop;
    };
    }
    </script>
    </head>
    <body onLoad="initScroll();">
    <div id='table_container_left'>
    <table id="left_table">
    <thead>
    <tr>
    <th class='locked_left'>Number</th>
    <th class='locked_left'>English</th>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td class='locked_left'>1</td>
    <td class='locked_left'>one</td>
    </tr>
    <tr>
    <td class='locked_left'>2</td>
    <td class='locked_left'>two</td>
    </tr>
    <tr>
    <td class='locked_left'>3</td>
    <td class='locked_left'>three</td>
    </tr>
    <tr>
    <td class='locked_left'>4</td>
    <td class='locked_left'>four</td>
    </tr>
    <tr>
    <td class='locked_left'>5</td>
    <td class='locked_left'>five</td>
    </tr>
    </tbody>
    </table>
    </div>
    <div id='table_container_right'>
    <table id="right_table">
    <thead>
    <tr>
    <th>French </th>
    <th>German </th>
    <th>Spanish</th>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td>un</td>
    <td>eins</td>
    <td>one-es</td>
    </tr>
    <tr>
    <td>deux</td>
    <td>zwei</td>
    <td>two-es</td>
    </tr>
    <tr>
    <td>trois</td>
    <td>drei</td>
    <td>three-es</td>
    </tr>
    <tr>
    <td>quatre</td>
    <td>vier</td>
    <td>four-es</td>
    </tr>
    <tr>
    <td>cinq</td>
    <td>fünf</td>
    <td>five-es</td>
    </tr>
    </tbody>
    </table>
    </div>
    </body>
    </html>
    melondotnet's Avatar
    melondotnet Posts: 23, Reputation: 1
    New Member
     
    #2

    Apr 29, 2008, 01:27 PM
    Umm, quick note, it is worth defining the type of style you are using in the head:

    <style type="text/css">

    CSS
    CSS
    CSS

    </style>
    jstrike's Avatar
    jstrike Posts: 418, Reputation: 44
    Full Member
     
    #3

    Sep 10, 2008, 05:46 PM
    Not easily.
    You might want to try something like Active Widgets

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Looking for a software where I can combine photos [ 4 Answers ]

Hello Im looking for a photo software where I can put numerous pictures together on one surface moving them freely on top of others and back, like in reality with printed photos and save it as new photo. PhotoScape has that option where you can combine pictures but you can't cros them over and...

Is there a way to combine two hard drives? [ 3 Answers ]

Not partitions, hard drives? I wanted to reformat my PC but they're broken up into two 40 Gig hard drives, is there anyway to combine both drives so I could install Windows XP on one drive?

How to combine different ions? [ 1 Answers ]

What will Pb+CO produce when they are combined together?

Combine an equation? [ 4 Answers ]

This is stupid I know but how do I combine this? D - (d + c) I got -C but somehow I think I'm really wrong. Thanks


View more questions Search