There is a study guide for To Kill A Mockingbird here on eNotes that has several summaries, one of which has chapter summaries that all include an analysis. Chapter 17-21 hold the details for the trial.
Tom is accused of raping Mayella Ewell, and Mr. Ewell, Mayella's father, is the first person to take the stand. He claims to have seen Tom raping Mayella, but Attticus tries to show that he is lying because the bruises on the rigt side of Mayella's face mean she was beaten by a left-handed man, and while Mr. Ewell is left-handed, Tom's left hand is withered and lifeless.
Mayella takes the stand next, where Atticus tries to get her to admit that her father is the one responsible for beating her. She says it was Tom, and even after Atticus gets her to admit that her father's behavior changes when he has been drinking, she immediately follows this statement by saying her father never hurt her and that if the court doesn't get Tom for raping her they are all cowards.
After Mayella speaks, it is time for Tom's examination. Tom says he helped Mayella out all the time because he felt sorry for her, and that on the day he allegedly raped her she had invited him to her house and she had put her arms around him and kissed him. When Mr. Ewell came and saw Tom with Mayella, Tom was scared so he ran off. Mayella refuses to lay any blame on her dad and still insists it was Tom.
After everyone is heard, the court finds Tom guilty.
For more details about the court scene, check out those chapter summaries as well as the other overall summaries that the study guide has to offer. The link is provided below.