[EDIT] Thanks for the help from prasad and Vijayp, i solved the the issue of setting up borders. However, another question is not fully addressed. I apologized for not making it clear. My question is that after dynamically created the table. You can see there are 5 horenzontal borders.(Please see picture below) I want to assign each honrizontal border an id. For instance, I want to assgin the the top border an id of 0; the second top border an id of 1, etc However, I do not know how to do it. Hope someone could help me out. Thanks for the help from prasad and Vija