1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
<?php function highlight_num($file) { $lines = implode(range(1, count(file($file))), '<br />'); $content = highlight_file($file, true);
echo ' <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;}
body {margin: 0px; margin-left: 5px;} td {vertical-align: top;} code {white-space: nowrap;} </style>'; echo "<table><tr><td class=\"num\">\n$lines\n</td><td>\n$content\n</td></tr></table>"; } highlight_num(__FILE__); ?>
|