html: use a state table to call the state handler functions