Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[PHP] Table generator.

duck you, I'm a dragon
Loyal Member
Joined
Apr 29, 2005
Messages
6,407
Reaction score
130


It's not really finished yet, because I need to find a way to print the code. Anyway, feedback is appreciated.
 
Legendary Battlemage
Joined
Nov 18, 2006
Messages
640
Reaction score
0
hmm to prinit it is java an opiton??
Code:
<script language="JavaScript">
<!-- Begin
if (window.print) {
document.write('<form>'
+ '<input type=button name=print value="Print This Page" '
+ 'onClick="java script:window.print()"> </form>');
}
</script>
hope i helped
 
Custom Title Activated
Loyal Member
Joined
Aug 8, 2004
Messages
3,892
Reaction score
20
Erm, whats the use of it? I mean, you could write this in about 5 lines of code.. :eh:
 
Custom Title Activated
Loyal Member
Joined
Aug 8, 2004
Messages
3,892
Reaction score
20


The complete source:
PHP:
for($i = 0; $i < intval($_GET['rows']); $i++) {
  $output .= "<tr height=10>";
  for($j = 0; $j < intval($_GET['colls']); $j++)
    $output .= "<td width=10>  </td>\n";
  $output .= "</tr>\n";
}
$output = "<table border=1>" . $output . "</table>";
echo $output . "<p> " . nl2br(htmlentities($output));

Ok, that was 8 lines of code, but at least it shows the table source as well... :icon6:
 
All is well...
Loyal Member
Joined
Feb 22, 2006
Messages
1,520
Reaction score
0
Nah, just store all that code in a variable and then skim a bit off Frag's code and print it out lol
Putting it inside some sort of separated box would make it look fancier lol maybe a txtbox or a colored div?

But I do like Pie's better than Frag's just because rather than changing url vars Pie's has the fields for it, just more user friendly ^_^
Course you can combine them together and use both.

But if you really want to be fancy you can give it formatting ^_^
Just throw in a few of those \t's and some font tags and make it look like some program's code viewer hehe. Possibly a printf? But I've yet to understand how printf works lol... I just avoid it and do things the long way
 
Custom Title Activated
Loyal Member
Joined
Aug 8, 2004
Messages
3,892
Reaction score
20
Yeah, didn't want to bother with input fields, though ofcourse adding those is just another few lines of code :wink: Merely wanted to show that this is about as spectaculair as a paper hat, no offence meant..
 
Back
Top