The terms "tram" and "tramway" are originally Scottish words from around 1500 for the type of truck used in coal mines and the tracks on which they ran, probably derived from Middle Low German and Middle Dutch trame "beam, handle of a barrow, bar, rung", meaning the beam or shaft of a barrow or sledge, also the barrow itself.
The street tram was invented in New York in 1830 by John Stephenson, an Irish coach builder, although the term tram didn't take off there; "streetcar" was and is used instead.
Initially these were horse-drawn, then steam locos were used in places (suitably adapted for street use), and some cable winding machinery systems such as in San Francisco were developed. Later when power from overhead electric wires became universal, the term trolley was used in North America; this was only adopted in the UK to refer to buses which use two overhead wires, one for the current return (on a street tram the current return is through the ground).
Tram-car is first mentioned in the UK in 1873. The terms "tram" and "tramway" have beeen adopted in most European countries except Germany - Strassenbahn "street railway" - although overland light rail lines have been refered to as trams there, too.
In Australia and New Zealand the term tram was also often used for a roughly built, often limited life, railway used for mining and forestry.