To do that, you could addthe following CSS styles for your <pre> tags -
<style>
pre
{
white-space: -moz-pre-wrap;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
white-space: pre-wrap;
word-wrap: break-word;
}
</style>
This code is tested and works in all major browsers.