I made my own table code for a few different apps and it works well. For the last one I did, I had it so that you could specify 3 options for the table: border thickness, width, and alignment. It wouldn't work with Snitz code the way it is now, but it could be tweaked to make it work. I store my "code" in the database as is and convert it to html only when displaying it on the page. That way I don't have to convert both ways when needing to edit the contents.
Inside whatever function converts code to html, the following would need to be placed before doing any Replace on vbNewline, vbCrLf, etc.:
Set re = New RegExp
re.Pattern = "\[table=(\d+),(1?[0-9]{1,2}%|auto),(right|left)\]\s?"
re.Global = True
re.IgnoreCase = True
re.MultiLine = True
if re.Test(strText) then
strText = re.Replace(strText,"<table bgcolor=""black"" border=""0"" cellpadding=""3"" cellspacing=""" & "$1" & """ style=""width:" & "$2" & """ align=""" & "$3" & """>")
end if
re.Pattern = "\[table=(\d+),(1?[0-9]{1,2}%|auto),none\]\s?"
re.Global = True
re.IgnoreCase = True
re.MultiLine = True
if re.Test(strText) then
strText = re.Replace(strText,"<table bgcolor=""black"" border=""0"" cellpadding=""3"" cellspacing=""" & "$1" & """ style=""width:" & "$2" & """>")
end if
set re = Nothing
strText = Replace(strText,"[/table]" & vbCrLf,"</table>")
strText = Replace(strText,"[/table]","</table>")
strText = Replace(strText,"[[","<tr><td bgcolor=""#faebd7"">")
strText = Replace(strText,"]]" & vbCrLf,"</td></tr>")
strText = Replace(strText,"]]","</td></tr>")
strText = Replace(strText,"]" & vbCrLf & "[","</td><td bgcolor=""#faebd7"">")
strText = Replace(strText,"][","</td><td bgcolor=""#faebd7"">")
An example of the code would be:
[table=1,50%,right]
[[cell 1][cell 2][cell 3]]
[[cell 4][cell 5][cell 6]]
[/table]
The only problem is if you don't have the same number of columns in each row (so no colspan) or if a [ or ] were left out.
I also have some javascript so that when someone copies and pastes tab delimited text (from excel or from a table in word for instance) inside the textarea, highlights it, and clicks the table button, the code is placed correctly around each of the cells.