Hermione took her leave as she didn't want to be around the fakeness of her "friends" anymore and she could already hear Ron talking about her as the rest would listen. It may sound crazy because of the way they treat her, but Hermione always loved walking past the Slytherin table because she knew they were dickheads, but their loyalty and friendship with each other was something she wished she could have at Hogwarts.