FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Order of Echoed HTML Output
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Order of Echoed HTML Output [message #179568 is a reply to message #179561] Thu, 08 November 2012 01:14 Go to previous messageGo to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma:
Senior Member
On Wed, 07 Nov 2012 10:04:23 -0800, bobgatski wrote:

> I have this code in a simple php file ...
>
> $which_table_to_dump = "Publisher_Records";
> require ('table2html-i-withbuttons.php');
>
> echo "<br/>back from table2html-i-withbuttons.php<br/>";
>
> ... The file, table2html-i-withbuttons.php (an earlier version was
> called 'dumptable'), simply outputs, using echo, the right html table
> tags, and data from the table, to display the table (specified by the
> variable $which_table_to_dump.
>
> My confusion and problem is that the echo ("back from ...") appears in
> the browser window ABOVE the table!
>
> Can anyone explain why that is?

The only place inside a table that content can appear is inside a cell
within the table (ie inside a td or th).

If you're outputting text outside of the cells but inside the table
structure, then the browser will try and interpret your misplaced text
according to the whims of whoever coded it.

Use the "view source" option of the web browser to see what html is
actually being generated.

Save the following (invalid) html as a file and open it in your browser
if you want to investigate the whims of the coders of your browser.

<html>
<head>
<title>Broken Table</title>
</head>
<body>
<table>
text before the rows
<tr>
text before the header cells
<th>header cell 1</th>
text between the header cells
<th>header cell 2</th>
text after the header cells
</tr>
text between the rows
<tr>
text before the cells
<th>cell 1</th>
text between the cells
<th>cell 2</th>
text after the cells
</tr>
text after the rows
</table>
</body>
</html>

In my firefox, all the wrongly positioned text is concatenated with
intervening whitespace into a single text node prior to the table.

Rgds

Denis McMahon
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Problem creating XML file
Next Topic: Analista Programador PHP
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 17:56:51 GMT 2024

Total time taken to generate the page: 0.05669 seconds