problem with inserting a table into a table

problem with inserting a table into a table

my intent was to insert a table into a table. I thought it was going to be straight forward code. as it turns out there are some land mines.

first i wrote the HTML opening
print(’ txt test ');

followed by the main table
$f1 = <<< MF

inserted table
MF ; print($f1);

next was a javascript set variable statement using the getElementById statement.
here is what i found:
a- setting to a simple text worked ok (it changed the contents on the screen)
b- as did some simple HTML (
) added
c- as did a variable loaded with a table statement that contained NO line breaks
d- provided I changed the quote to double-quote
e- if i added 1 line break it failed
f- my intention was to take a simple table statement (like one that would be produced by MS word or some open equivalent ) and insert it via a named element.

all the code is at the bottom of this letter - nothing is out of the ordinary PHP so i can’t blame some function not documented.

what did i do wrong?

Paul Alagna

[php]<?php
// file txt test
//
print(’ txt test ');
$f1 = <<< MF

inserted table
MF ; print($f1); $f2 = <<< MF
inserted inserted table
MF ; $f3 = <<< MF
inserted table table
MF ; // no cr $f3a = <<< MF
inserted table table
MF ; // one cr // document.getElementById('td1').innerHTML = 'george'; // works // document.getElementById('td1').innerHTML = '
george'; // works // document.getElementById('td1').innerHTML = "$f3"; // works // document.getElementById('td1').innerHTML = '$f3'; //no // document.getElementById('td1').innerHTML = '$f3'; //no // document.getElementById('td1').innerHTML = "$f3a"; // no // document.getElementById('td1').innerHTML = '$f2'; // no // document.getElementById('td1').innerHTML = "$f2" // no

$tt = <<< GG

GG
;
print($tt);
print(’’);
?>
[/php]

What you are trying to do makes absolutely no sense. Why are you trying to embed a table within a table in the first place? HTML and CSS have come a long ways, so there is no purpose of using tables for layout, with the exception of email but that isn’t what you are doing. Table elements should ONLY be used for tabular data, which makes embedding the break that practice.

Sponsor our Newsletter | Privacy Policy | Terms of Service