Bangladesh's decision to bowl first on the opening day of the Test series backfired in a big way as South Africa cruised to 298/1 at stumps on Thursday. Bangladesh's gamble was a surprise on a Potchefstroom pitch that was predicted to favour the batsmen early in the game, and captain Mushfiqur Rahim's call put his team under pressure immediately.
None of the seven Bangladesh bowlers who were given a go on the tame pitch at Senwes Park had any success, with Markram run out to miss out on a century on debut.
But that was South Africa's only minor disappointment, with the host starting its home season strongly on a pitch that Bangladesh's bowlers got no help on.
Elgar moved serenely to a ninth Test century, and fourth this year, and put on 196 for the first wicket with Markram.
Elgar and Amla added another 102 in their unbroken second-wicket stand. Elgar overtook India's Cheteshwar Pujara as the leading run-scorer in test cricket this year.
Markram, who came close to making his debut in England this year, hit 13 fours to take his chance at the top of the order. South Africa has been seeking a reliable opening partner for Elgar.
He was on course to be the seventh South African to make a century on debut but was denied in a bad mix-up with Elgar. Elgar played to backward point, appeared to want a run, but then sent Markram back. Sabbir Rahman and bowler Mehidy Hasan Miraz combined for the run-out, with Markram way out.
New coach Ottis Gibson will still have been pleased with the strong start in his first match in charge of South Africa.
The former West Indies coach faces a challenging first season with the Proteas, with tests against Bangladesh and Zimbabwe followed by back-to-back tours by top-ranked Test team India and then Australia.