I saw something once to keep columns from changing widths, but know I can't find it! My columns change widths if they have information in them to when they don't. I have played with width= but they still don't stay the same. Here is my code:
for x = datadate to today step 7
subtable = false
lastdate = "none"
mysql = "SELECT [date] as PunchDate, [In] as InPunch,[Out] as OutPunch FROM Punches WHERE employee_number = '"&Session("EmpNum"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
mysql = mysql &"' and [date] BETWEEN #" & x & "# AND #" & x+6 & "# ORDER BY [date]"
set lors = myconnection.execute (mysql)
%>
<table border="1" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" >
<%
'Writing Dates to Table with a Loop
for z = 0 to 6
response.write "<th colspan=1 colgroup width=""125""><p align=""center""><font face=""Tahoma"" size=""1"">" & dateadd("d",z,x) & "</th></td>"
next
'Writing days of week to table
response.write "<tr><th colspan=1 colgroup width=""125""><p align=""center""><font face=""Tahoma"" size=""1"">Sun</th><th colspan=1><p align=""center""><font face=""Tahoma"" size=""1"">Mon</th><th colspan=1><p align=""center""><font face=""Tahoma"" size=""1"">Tues</th><th colspan=1><p align=""center""><font face=""Tahoma"" size=""1"">Wed</th><th colspan=1><p align=""center""><font face=""Tahoma"" size=""1"">Thurs</th><th colspan=1><p align=""center""><font face=""Tahoma"" size=""1"">Fri</th><th colspan=1><p align=""center""><font face=""Tahoma"" size=""1"">Sat</th></tr>"
'Writing Punches to Table
do while not lors.eof
InPunch = lors.fields("InPunch"
.value
OutPunch = lors.fields("OutPunch"
.value
PunchDate = lors.fields("Punchdate"
.value
if lastdate <> punchdate then
if lastdate = "none" then
if weekday(punchdate -1) <> 7 then
for y = 1 to weekday(punchdate -1)
response.write "<td> </td>"
next
end if
else
response.write "</table>"
if weekday((punchdate - lastdate) - 1) <> 7 then
for y = 1 to (weekday(punchdate - lastdate) - 1)
response.write "<td> </td>"
next
end if
end if
response.write "<td valign=top ><table border=""0"" cellpadding=""2"" cellspacing=""0"" bordercolor=""#111111"" valign=top >"
subtable = true
else
if subtable <> true then
response.write "<td valign=top ><table border=""0"" cellpadding=""2"" cellspacing=""0"" bordercolor=""#111111"" valign=top >"
end if
end if
response.write "<td nowrap=""nowrap"" colspan=1 align=top colgroup width=""62""><valign =""top""><p align=""left""><font face=""Tahoma"" size=""1"">" & InPunch & " " & "<td nowrap=""nowrap"" colspan=1 align=top colgroup width=""62""><valign =""top""><p align=""right""><font face=""Tahoma"" size=""1"">" &" "& OutPunch & "</td><tr>"
lastdate = punchdate
lors.movenext
loop
response.write "</table></td>"
if subtable = true then
for y = 1 to (7 - weekday(lastdate))
response.write "<td> </td>"
next
end if
next
Any suggestions would be awesome! Thanks.
for x = datadate to today step 7
subtable = false
lastdate = "none"
mysql = "SELECT [date] as PunchDate, [In] as InPunch,[Out] as OutPunch FROM Punches WHERE employee_number = '"&Session("EmpNum"
mysql = mysql &"' and [date] BETWEEN #" & x & "# AND #" & x+6 & "# ORDER BY [date]"
set lors = myconnection.execute (mysql)
%>
<table border="1" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" >
<%
'Writing Dates to Table with a Loop
for z = 0 to 6
response.write "<th colspan=1 colgroup width=""125""><p align=""center""><font face=""Tahoma"" size=""1"">" & dateadd("d",z,x) & "</th></td>"
next
'Writing days of week to table
response.write "<tr><th colspan=1 colgroup width=""125""><p align=""center""><font face=""Tahoma"" size=""1"">Sun</th><th colspan=1><p align=""center""><font face=""Tahoma"" size=""1"">Mon</th><th colspan=1><p align=""center""><font face=""Tahoma"" size=""1"">Tues</th><th colspan=1><p align=""center""><font face=""Tahoma"" size=""1"">Wed</th><th colspan=1><p align=""center""><font face=""Tahoma"" size=""1"">Thurs</th><th colspan=1><p align=""center""><font face=""Tahoma"" size=""1"">Fri</th><th colspan=1><p align=""center""><font face=""Tahoma"" size=""1"">Sat</th></tr>"
'Writing Punches to Table
do while not lors.eof
InPunch = lors.fields("InPunch"
OutPunch = lors.fields("OutPunch"
PunchDate = lors.fields("Punchdate"
if lastdate <> punchdate then
if lastdate = "none" then
if weekday(punchdate -1) <> 7 then
for y = 1 to weekday(punchdate -1)
response.write "<td> </td>"
next
end if
else
response.write "</table>"
if weekday((punchdate - lastdate) - 1) <> 7 then
for y = 1 to (weekday(punchdate - lastdate) - 1)
response.write "<td> </td>"
next
end if
end if
response.write "<td valign=top ><table border=""0"" cellpadding=""2"" cellspacing=""0"" bordercolor=""#111111"" valign=top >"
subtable = true
else
if subtable <> true then
response.write "<td valign=top ><table border=""0"" cellpadding=""2"" cellspacing=""0"" bordercolor=""#111111"" valign=top >"
end if
end if
response.write "<td nowrap=""nowrap"" colspan=1 align=top colgroup width=""62""><valign =""top""><p align=""left""><font face=""Tahoma"" size=""1"">" & InPunch & " " & "<td nowrap=""nowrap"" colspan=1 align=top colgroup width=""62""><valign =""top""><p align=""right""><font face=""Tahoma"" size=""1"">" &" "& OutPunch & "</td><tr>"
lastdate = punchdate
lors.movenext
loop
response.write "</table></td>"
if subtable = true then
for y = 1 to (7 - weekday(lastdate))
response.write "<td> </td>"
next
end if
next
Any suggestions would be awesome! Thanks.