This article is about David's daughter. You may be looking for Er's wife.
Tamar was a daughter of David and Maacah and Absalom's sister. She is noted by the author of the Book of Samuel| as a beautiful woman. Her step-brother, Amnon became besotted with her. Desperate to have a romantic encounter with her, Amnon pretended to be ill and asked Tamar to care for him. While she was alone with Amnon, he made advances towards her which she refused and then Amnon raped her.
After this, Tamar begged Amnon to marry her (who became hateful towards) and he refused her this. Thus, Tamar was sentenced to a life of shame by the loss of her virginity- in those days she would have been viewed as undesirable wife and her chances for an ideal Israelite life were ruined. After the incident, Absalom tried to comfort her and she lived with her brother in his house in the palace complex.
The account of Tamar's rape serves as the instigation of Absalom's coup and the turmoil in David's life- brought about as the consequence of his adultery with Bathsheba and murder of Uriah the Hittite.