Are you trying to create customized result formats or changing the search FORM (as in the default search.html generated by ht://Dig)?

For the first one, you can create header and footer templates, which is located in the common directory. This will have htdig wrap the results within any design you might like.
For the second one, I suggest reading one of the gazillion HTML howtos on the internet that explain FORM/CGI.