Vote, med cookie sikring + problem ved witdh
Hey.Jeg har lavet en Poll på min klan side, det virker ok.. bare et prob.
Jeg har en tabel hvor Poll'en sidder i en td der er 140 bred, men når den viser results så bliver den bredere.. hva skal jeg gøre...
Her er koden:
<html>
<head>
<title>PollBuddy - Results</title>
<style type="text/css">
body {
margin : 0px;
color : #000000;
background-color : #ffffff;
}
.question {
font-family : arial, helvetica, monaco, sans-serif;
font-size : 13px;
font-weight : bold;
color : #303090;
background-color : transparent;
margin-left : 0px;
margin-right : 0px;
margin-top : 8px;
margin-bottom : 8px;
}
.responses {
font-family : arial, helvetica, monaco, sans-serif;
font-size : 12px;
font-weight : bold;
color : #000000;
background-color : transparent;
margin-left : 0px;
margin-right : 0px;
margin-top : 4px;
margin-bottom : 4px;
}
.percent {
font-family : arial, helvetica, monaco, sans-serif;
font-size : 12px;
color : #000000;
background-color : transparent;
margin-left : 0px;
margin-right : 0px;
margin-top : 4px;
margin-bottom : 4px;
}
.totalvotes {
font-family : arial, helvetica, monaco, sans-serif;
font-size : 12px;
color : #000000;
background-color : transparent;
margin-left : 0px;
margin-right : 0px;
margin-top : 8px;
margin-bottom : 8px;
}
</style>
<!--#include file ="variables.asp"-->
<%
'find which is the largest number of votes
Dim mostvotes
mostvotes = 0
For i = 1 to 8
If mostvotes < votes(i) Then
mostvotes = votes(i)
End If
Next
'calculate the total number of votes
Dim totalvotes
totalvotes = 0
For i = 1 to 8
totalvotes = totalvotes + votes(i)
Next
%>
</head>
<body>
<div class="question" witdh="140"><% Response.Write(question) %></div>
<table witdh="140">
<%
For i = 1 to 8
If responses(i) <> "" Then
%>
<tr>
<td align="right"><div class="responses" witdh="140"><% Response.Write(responses(i)) %></div></td>
<td>
<div class="percent">
<%
If votes(i) <> 0 Then
%>
<img src="bar1.gif" height="11" width="<%
Response.Write(Round((votes(i) / mostvotes * 150),0))
%>" alt="" /> <%
Response.Write(Round((votes(i) / totalvotes * 100),0) & "%")
Else
%> 0%
<%
End If
%>
</div>
</td>
</tr>
<%
End If
Next
%>
</table>
<div class="totalvotes" witdh="140">Total number of votes: <% Response.Write(totalvotes) %></div>
</body>
</html>
