Mr Trump's fellow Republicans voted 52-48 to approve the judge, overcoming the opposition of Democrats.