If we treat the absences as very wimpy nay votes, and lump the 2 independents in with the party they caucus with (both Democrat), then the party breakdown looks like this:
Democrats: 35 yea, 12 nay, so ~75% in favor. Republicans, 24 yea, 29 nay, so ~45% in favor.
The 59 yea votes consisted of 35 Democrats (King is independent but caucuses with the Democrats), and 24 Republicans. I'm much more interested in why it failed to pass, so I'll refrain from listing the yea votes for brevity.
The 4 absent senators were 2 Democrats (Sanders is independent but caucuses with the Democrats), and 2 Republicans:
Alexander (R-TN) Murray (D-WA) Sanders (I-VT) Sasse (R-NE)
The 37 nay votes were from 10 Democrat and 27 Republican senators:
Barrasso (R-WY) Blackburn (R-TN) Blunt (R-MO) Boozman (R-AR) Burr (R-NC) Capito (R-WV) Carper (D-DE) Casey (D-PA) Collins (R-ME) Cornyn (R-TX) Cotton (R-AR) Feinstein (D-CA) Fischer (R-NE) Graham (R-SC) Hassan (D-NH) Hyde-Smith (R-MS) Inhofe (R-OK) Johnson (R-WI) Jones (D-AL) Kaine (D-VA) Lankford (R-OK) Manchin (D-WV) McConnell (R-KY) Perdue (R-GA) Portman (R-OH) Roberts (R-KS) Romney (R-UT) Rubio (R-FL) Shaheen (D-NH) Shelby (R-AL) Thune (R-SD) Tillis (R-NC) Toomey (R-PA) Warner (D-VA) Whitehouse (D-RI) Wicker (R-MS) Young (R-IN)