A person in good health with good form can type with reasonable (not ideal) comfort on a standard keyboard on any height table (within reason), but:
(0) Try to feel in your body what kind of static load is on your muscles and joints. Ideally you want your body parts to be in neutral relaxed positions. It's not always possible to completely avoid static load, so try to take routine breaks, change positions, etc.
(1) At all costs avoid having nontrivial wrist extension or flexion (wrists bent upward or downward) while doing repetitive finger motions. Your hands need to be coming straight out of your forearms. The tendons that flex and extend the fingers need to pass through the wrists, and a bent wrist leaves them moving in a weak and uncomfortable part of their range of motion. My understanding is that most keyboard-related RSI comes from wrist extension or flexion.
(2) You should try to get your arms to be supported as much as possible passively from the shoulders. When sitting or standing, the upper arms should be hanging loosely at your sides with back reasonably straight and head up. The keyboard needs to be close enough to the torso for this to be possible. If your elbows are not close to your body, but are forward or out to the side, try to change your position. Being in a position where the weight of the arms is supported by the arm muscles causes fatigue and encourages compromising other joint positions in uncomfortable or damaging ways to relieve the strain. While actively typing the hands do not need to be supported by any kind of surface: let the palms "float" above the keyboard. Use the palm rest for resting, not typing.
(3) For a single-piece flat keyboard, I find it is most comfortable for the plane of the keyboard to be parallel to the forearms. The appropriate front/back tilt of the keyboard is therefore dependent on the relative height of the keyboard and the torso: if the table is high relative to the chair, the keyboard needs to be tilted up at the far side; if the keyboard is on your lap, on a low under-desk keyboard tray, or on a belly-height standing desk, then the keyboard needs to be flat or even tilted down at the far side. The major reason that old typewriters had an aggressive tilt to them was because desks are historically the right height for handwriting (i.e. tall).
(4) I find it helps a lot on a one-piece keyboard to keep the wrists with little to no ulnar deviation (turn toward the outside). It also helps to try to pronate them less (i.e. leave them turned so that the pinkies are a bit below the pointer fingers, instead of rotating them all the way flat). Split ergonomic keyboards eliminate the need to make some of these compromises by allowing the hands to be separated and allowing the sides to be "tented" (so the wrists can be less pronated) and positioned/oriented to eliminate ulnar deviation.
(5) Try not to have too sharp an impact on each keystroke. Ideally use only the necessary force for each key press to register, and try to avoid slamming your fingers down hard through the bottom of the keystroke. A keyboard with better switches can help a lot here, with reliable actuation halfway through the keystroke and tactile/auditory feedback at the actuation point. Key switches that don't reliably actuate unless smashed are the worst.