Help ASCII Table
Feeling bored with myself in the holidays (which happens quite often) I decided to take the "next step" forward and learn XHTML - Strict (because I am fairly confident I know XHTML Transitional) and with it CSS and PHP.
I set to work on a question that I get asked frequently, and that is
Friend: "What is the number for the character with ?"
Me: "I'm not too sure hang on"
[goes off to where abouts unknown to find the character]
Me: "The number is "
Friend: "Oh ok cool"
[me thinking to my self 'a think you would be me']
Anyway, I decided to make a webpage showing all the ASCII codes and number combinations.
The page can be found here:
http://chengeu.krayup.com/testing/charsinphp.php
Now the problem I having are those blank cells, how can I make it(using PHP coding not CSS) so that if there is no character or is blank it will output a ?
Another problem I am also having is that in XHTML - Strict you can't put ... How do I get around that without doing ... ?
Any other comments regarding my CSS,PHP , (X)HTMl coding are also appreciated.
I am not putting a doctype up yet so that I can choose what I want to valid date it as (XHTML - Strict).
And also, I put the PHP loop in a function cause I want to learn how to use functions.
The source code can be found here:
http://chengeu.krayup.com/testing/charsinphp.phps
Mark Hensler posted this at 19:34 — 25th April 2003.
He has: 4,048 posts
Joined: Aug 2000
I've always used this site: http://www.jimprice.com/jim-asc.htm
It has both the IBM extended ACII chart and the Microsoft Windows extended ASCII chart.
(Will someone please tell me why Microsoft feels the need to tamper with predefined standards? )
Mark Hensler
If there is no answer on Google, then there is no question.
Renegade posted this at 00:46 — 26th April 2003.
He has: 3,022 posts
Joined: Oct 2002
Cool thanks Mark, I've added it to my bookmarks list.
However I would still like to make that table :S
ROB posted this at 01:00 — 26th April 2003.
They have: 447 posts
Joined: Oct 1999
as far as the blank cells, just put an on either side of the value
for instance
<td>&nbsp;&#009;&nbsp;</td>
'it'll still be centered and the cells will show up.
Busy posted this at 04:06 — 26th April 2003.
He has: 6,151 posts
Joined: May 2001
I have a table of characters on my site, can be found here
you could always use as a default for every cell, so empty ones just have the default space.
Tables are valid XHTML Strict but are perfered to be used for data content, not layout, even thou you can get around it (isn't XHTML fun). the only real way to align the table is within the div tag but you can align the contents with either CSS (text-align:?) or TH (default is bold and centered) - i think th is valid
just remember to keep everything lower case with php and use & for &
Renegade posted this at 10:44 — 26th April 2003.
He has: 3,022 posts
Joined: Oct 2002
The whole table is generated with a few lines of PHP coding but I would like to know how to change the cells which have nothing to having a
How would I do that?
dk01 posted this at 13:24 — 26th April 2003.
He has: 516 posts
Joined: Mar 2002
Just so you know that although they may display nothing some results of the chr() function are tabs, carriage returns, etc: http://www.php.net/manual/en/function.chr.php
As far as making the default in cells goes it is not an attribute or anything. Just have it in every cell. So change this:
<?php
echo \"<tr><td><p class=\\"center\\">\" . $i . \"</p></td><td width=\\"100\\"><p class=\\"center\\">\" . $character . \"</p></td></tr>\n\";
?>
to this:
<?php
echo \"<tr><td><p class=\\"center\\"> \" . $i . \"</p></td><td width=\\"100\\"><p class=\\"center\\">\" . $character . \"</p></td></tr>\n\";
?>
This is what rob suggested.
-dk
Renegade posted this at 09:58 — 27th April 2003.
He has: 3,022 posts
Joined: Oct 2002
Oh ok cool, Thanks
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.