Sub ExecuteHtml2(SQL As SQL, Query As String, StringArgs() As String, Limit As Int, Clickable As Boolean) As String
'as ExecuteHtml but extra <td> with value as link. with ~ as split
Dim Table As List
Dim cur As Cursor
If StringArgs <> Null Then
cur = SQL.ExecQuery2(Query, StringArgs)
Else
cur = SQL.ExecQuery(Query)
End If
Log("ExecuteHtml2: " & Query)
If Limit > 0 Then Limit = Min(Limit, cur.RowCount) Else Limit = cur.RowCount
Dim sb As StringBuilder
sb.Initialize
sb.Append("<html><body>").Append(CRLF)
sb.Append("<style type='text/css'>").Append(HtmlCSS).Append("</style>").Append(CRLF)
sb.Append("<table><tr>").Append(CRLF)
For i = 0 To cur.ColumnCount - 1
sb.Append("<th>").Append(cur.GetColumnName(i)).Append("</th>")
Next
sb.Append("<th style='width:30px align=center'>").Append("M/D").Append("</th>")
sb.Append("</tr>").Append(CRLF)
ColCount=0
For row = 0 To Limit - 1
cur.Position = row
'If row Mod 2 = 0 Then
' sb.Append("<tr class='odd'>")
'Else
sb.Append("<tr class='odd'>")
'End If
ColCount=cur.ColumnCount
For i = 0 To cur.ColumnCount - 1
sb.Append("<td>")
If Clickable Then
sb.Append(cur.GetString2(i))
Else
sb.Append(cur.GetString2(i))
End If
sb.Append("</td>")
Next
sb.Append("<td style='width:30px' Align='Center'>")
sb.Append("<a href='http://")
For t=0 To cur.ColumnCount-1
sb.Append(cur.GetString(cur.GetColumnName(t)))
sb.Append("~")
Next
sb.Append(".com'>")
'<img src='file:///android_asset/question.png'/>
'sb.Append("Edit</a>")
sb.Append("<img src='file:///android_asset/edit.jpg' width=50 height=30 /></a>")
sb.Append ("</td>")
sb.Append("</tr>").Append(CRLF)
Next
cur.Close
sb.Append("</table></body></html>")
Return sb.ToString
End Sub