/    Sign up×
Community /Pin to ProfileBookmark

Can’t view rows of two table with the same positions

Hi,

I have a javascript or CSS problem with two tables with same positions.
The two tables has the same structure and positon in page.I want to view the odd lines from a table and the even lines from the oher table.
What I have do is the following :

[CODE]
<style type=”text/css”>
#slideshow{
background:url(‘templates/images/femeielaptop.jpg’);
width:666px;
height:390px;
position:absolute;
border-style:solid;
border-color:black;
border-width:1px;
margin-left:10px;
}
#slideshow2{
background:url(‘templates/images/img1.jpg’);
width:666px;
height:390px;
position:absolute;
border-style:solid;
border-color:black;
border-width:1px;
margin-left:10px;
}
</style>
<script type= “text/javascript” src=”js/ext/adapter/ext/ext-base.js”></script>
<script type= “text/javascript” src=”js/ext/ext-core.js”></script>
<script type= “text/javascript” src=”js/ext/ext-core-debug.js”></script>
<script type= “text/javascript” src=”js/ext/ext-all.js”></script>
<script type= “text/javascript” src=”js/ext/ext-all-debug.js”></script>
<script type=”text/javascript”>
for(j=0;j<13;j++){
if (j%2==0){
Ext.get(‘line’+j).setStyle({‘z-index’:’99’});
Ext.get(‘line’+j).setStyle({‘visibility’:’visible’});
var randomdiv={};
}
else {
Ext.get(‘linei’+j).setStyle({‘z-index’:’0′});
Ext.get(‘linei’+j).setStyle({‘visibility’:’hidden’});
}
}
</script>
……
<table id=”slideshow2″>
<%
for j=0 to 280/23
if j mod 2=0 then
Response.Write “<tr height=’30px’>”
for i=0 to 660/23
Response.Write “<td id=divmici” & i & “__” & j & ” style=’border-style:solid;border-color:black;border-width:1px;width:2px;height:20px;position:relative;margin-left:” & 23 * i & “px;margin-top:” & 23 * j & “px;visibility:visible;’>&nbsp;</td>”
next
Response.Write “</tr>”
else
Response.Write “<tr id=’linei”& j &”‘>”
Response.Write “<td id=’divmic2” & j & “‘ colspan='” & 660/23+1 & “‘>&nbsp;</td>”
Response.Write “</tr>”
end if
next
%>
</table>
<table id=”slideshow”>
<%
for j=0 to 280/23
if j mod 2=0 then
Response.Write “<tr height=’30px’ id=’line”& j &”‘>”
for i=0 to 660/23 Response.Write “<td id=divmic” & i & “__” & j & ” style=’border-style:solid;border-color:black;border-width:1px;width:2px;height:20px;position:relative;margin-left:” & 23 * i & “px;margin-top:” & 23 * j & “px;visibility:visible;’>&nbsp;</td>”
next
Response.Write “</tr>”
else
Response.Write “<tr>”
Response.Write “<td id=’divmic” & j & “‘ colspan='” & 660/23+1 & “‘>&nbsp;</td>”
Response.Write “</tr>”
end if
next
%>
</table>
[/CODE]

After page loads I see just the tabel having id=’slideshow’.I have expected to see odd lines from the “slideshow2” table and even lines from the “slideshow” table.
What’s the reason that happening?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@TcobbDec 10.2010 — I am not altogether sure on this, but I think that just declaring element.style.position = "absolute" doesn't do much of anything unless you also add something like: element.style.top = "0px" and element.style.left = "0px"

That might solve your problem if you add the additional "left" and "top" elements to your code for both tables--making them identical.
×

Success!

Help @plaszma spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...