Elgar made 113 and Markram hit 143 as South Africa piled up 428 for three at the close in Bloemfontein.
Hashim Amla was unbeaten on 89 and in sight of his second century of the series, while South African captain Faf du Plessis was on 62 not out.
Markram's maiden century came in his second Test, eight days after he was run out for 97 in his debut innings during the first Test in Potchefstroom.
Bangladesh captain Mushfiqur Rahim won the toss and sent South Africa in, only for his bowlers to be put to the sword in a massive opening partnership.
The only major difference was that Bangladesh reshuffled their bowling attack, retaining only Mustafizur Rahman of their front-line bowlers.
The replacements made no significant improvement on those who had played in Potchefstroom.
Although the pitch had more pace and bounce than in the previous match, it only contributed to a faster scoring rate as the ball came on to the bat better.
Elgar followed up his 199 in Potchefstroom with his tenth Test century.
He made his runs off 152 balls, with 17 fours. When he reached 16 he became the first batsman in the world to score 1000 runs in 2017.
Neither batsman gave a chance until Elgar, on 110, gloved an attempted hook off Mustafizur and wicketkeeper Liton Das leapt high and got the tips of his right glove to the ball but could not hold on.
There was a brief lull after tea when Mustafizur and Roy picked up a wicket apiece and kept the scoring under control while Amla and Du Plessis were playing themselves in.
It didn't last long and the pair posted a century partnership off only 111 balls.
It was a day when virtually nothing went right for Bangladesh. After a fruitless morning they went back to their dressing room to find their halal food was still on the way. The resumption of play was delayed by ten minutes to enable them to eat.
Disclaimer: No Business Standard Journalist was involved in creation of this content
You’ve reached your limit of {{free_limit}} free articles this month.
Subscribe now for unlimited access.
Already subscribed? Log in
Subscribe to read the full story →
Smart Quarterly
₹900
3 Months
₹300/Month
Smart Essential
₹2,700
1 Year
₹225/Month
Super Saver
₹3,900
2 Years
₹162/Month
Renews automatically, cancel anytime
Here’s what’s included in our digital subscription plans
Exclusive premium stories online
Over 30 premium stories daily, handpicked by our editors


Complimentary Access to The New York Times
News, Games, Cooking, Audio, Wirecutter & The Athletic
Business Standard Epaper
Digital replica of our daily newspaper — with options to read, save, and share


Curated Newsletters
Insights on markets, finance, politics, tech, and more delivered to your inbox
Market Analysis & Investment Insights
In-depth market analysis & insights with access to The Smart Investor


Archives
Repository of articles and publications dating back to 1997
Ad-free Reading
Uninterrupted reading experience with no advertisements


Seamless Access Across All Devices
Access Business Standard across devices — mobile, tablet, or PC, via web or app
