0

Hey i have to make a pizza website for my assignment. I am done the HTML part and have finished the PHP more than half. I am trying to decorate it a bit and trying to use "\t" for tab, but its not working. Any suggestions?

P.S. I have made a separate PHP file.

echo "\t"."Confirmation Page<br/>";
$cost;
$counter=0;
echo "Personal data:<br/>";
isset($_POST["name"]) ? $name = $_POST["name"] : $name = "";
isset($_POST["phoneNumber"]) ? $phone = $_POST["phoneNumber"] : $phone = "";
echo $name."<br/>";
echo $phone."<br/><br/>";

I am having problems with "\t" in the first line.

Thanks :)

4
Contributors
8
Replies
13
Views
6 Years
Discussion Span
Last Post by diafol
0

From my understanding. \t only works to beautify your HTML, you don't get this output to the screen. Any tab space gets treated like any old whitespace anyway. The easiest way to do this is to use CSS and text-indent.

Edited by diafol: n/a

0

CSS in PHP? Can you provide me with an example? I am kinda new to PHP. Thanks for replying :)

0

instead of:

echo "\t"."Confirmation Page<br/>";

try:

echo "<div style='padding-left:10px;'>Confirmation Page</div>";
0

Oh wow, never knew we can use style in PHP. Thanks a lot :)

0

Avoid inline styles. Use classes and CSS files:

echo '<div class="ind">Confirmation Page</div>';

CSS:

.ind{
  text-indent: 5em;
}
0

Well you could use CSS but another solution is to use

<html>
<body>
<dd>Indented<br />
Non-Indented
</body>
</html>

Edited by thephpdev: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.