Ask Experts Questions for FREE Help!
Answer   ||    Advanced Search

Ask your question or search...
International Sites: Nederlandse experts vragen
User Name 
Password 
Join   Forgot password? 

Home > Computers & Technology > Programming > Markup Languages > HTML   »   How to combine 2 tabels into one (column freezing)

Question
 
 
#1  
Old Sep 5, 2007, 12:13 AM
sbware
New Member
sbware is offline
 
Join Date: Sep 2007
Posts: 1
sbware See this member's comment history on his/her Profile page.
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 insted of two in the following code. Is it possible to do that. I mean to achive 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>

Reply With Quote
 
     

Answers
 
 
Old Apr 29, 2008, 01:27 PM   #2  
New Member
melondotnet is offline
 
Join Date: Mar 2008
Posts: 23
melondotnet See this member's comment history on his/her Profile page.
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>
  Reply With Quote
 
     
 
 
Old Sep 10, 2008, 05:46 PM   #3  
Full Member
jstrike is offline
 
Join Date: May 2007
Location: Wisconsin - Go Packers!
Posts: 412
jstrike See this member's comment history on his/her Profile page.
Not easily.
You might want to try something like Active Widgets
  Reply With Quote
 
     

Your Answer
Email me when someone replies to my answer
Join Login



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Ask your question or search...



Similar Threads
what happens when H2SO4 + CuO combine? inferences?
(2 replies)
Linking Excel tabels one to another
(0 replies)
how do i combine multiple rar files into 1 video?
(2 replies)
combine DBA accounts
(1 replies)
How to combine multi projects into 1 ???
(0 replies)

Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page
Search this Thread

Advanced Search

Bookmarks





Copyright ©2003 - 2009, Ask Me Help Desk.
All times are GMT -8. The time now is 03:18 PM.