Get the Thickness planer first. You can make a jig for your table saw to cut the ends straight, then you can build a sled to mount the piece you plan on putting through the planer and stabilize it with shims and double sided tape. Send it through the planer till one side is straight then put the other side through.