Het gaat erom dat in het linker plaatje is de scrollbar te breed en lopen de lijnnummers door. In het rechterplaatje zie je dat de scrollbar niet wijd genoeg is, maar daarentegen werken de regelnummers wel weer goed.
Hoe krijg ik beide goed?
# Opmaak voor de regelnummers:
<style type="text/css">
.num {
float: left;
color: gray;
font-size: 13px;
font-family: monospace;
text-align: right;
margin-right: 6pt;
padding-right: 6pt;
border-right: 1px solid gray;}
</style>## Highlightfunctie
function customHighlight($code){
$code = highlight_string(htmlspecialchars_decode(strip_tags($code[1])), true);
$aLines = explode("<br />", $code);
$iLines = count($aLines);
$output = "<br /><table style=\"width: auto;\"><tr><td><b>PHP code</b></td></tr><tr><td class=\"num\">\n";
for($i = 1; $i <= $iLines; $i++){
$output .= $i ."<br />";
}
$output .= "\n</td><td style=\"overflow-x:scroll;display: block;width:80%;\">\n$code\n</td></tr></table>";
return $output;
}(niet letten op het script, dat heb ik ff als voorbeeld gebruikt :P)
Je kunt het op de volgende afbeelding zien..
[IMG]http://img25.imageshack.us/img25/1544/phphulp.th.jpg[/IMG]