hello all,
is there a way (using php or html) to force the browser to display white spaces at begining of a string inside a table cell?
i.e. if I have a string: " hello"
and I put it into a cell it prints out
"hello"
and I want to see is
" hello"
within the cell...
possible?
displaying white spaces in table cell
Moderator: General Moderators
Maybe a:
But then, using that, it would replace all the spaces, I doubt you'd want that, and it'd end up as <table\&\n\b\s\p\;cellpadding="0" etc.
But I might go along that str_replace line. Maybe use regular expressions to look for a <td> text</td> pattern?
-Nay
ps: I added the ''s since when you read the post, the entities kept changing into spaces.
Code: Select all
<?php
$text = str_replace(" ", "\&\n\b\s\p\;", $text);
?>But I might go along that str_replace line. Maybe use regular expressions to look for a <td> text</td> pattern?
-Nay
ps: I added the ''s since when you read the post, the entities kept changing into spaces.
Last edited by Nay on Wed Nov 19, 2003 7:39 am, edited 1 time in total.
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
no ... i don't think it's supported... white spaces before text in table cells..
either use
or else........
note : remove that "\" from "&\nbsp;" before using in code..
either use
Code: Select all
<table cellpading="10">
<tr>
<td><?php echo $string ?></td>
</tr>
</table>Code: Select all
<td>&\nbsp;<?php echo $string ?></td>-
microthick
- Forum Regular
- Posts: 543
- Joined: Wed Sep 24, 2003 2:15 pm
- Location: Vancouver, BC