“In spite of” in Chinese is 不顾 (bùgù).
生活中的朋友弃我们不顾之时,书随时给我们送来友谊、同情和鼓励。
When real life friends desert us, books are always ready to offer friendship, sympathy and motivation.
Example sentence from Tatoeba (CC BY 2.0).