Add sparse table demo and fix related selection bug

Change-Id: Ie8f28c3488cdc0750a99fa4f55dd9e1ebd0512d0