Donald J. Trump won the Electoral College with 304 votes compared to 227 votes for Hillary Clinton. Seven electors voted for someone other than their party’s candidate.