wow! That ' s a little more complicated. Let ' s break it down:
Line 3 splits the "pipes" and stores the pieces in the array $cells. Line 4 stores the number of items (number of cells) in $iterations. Line 6 begins we loop to go through these cell items. Line 7 splits the "cell data" in the colon and stores them into the variables $message and $span. Line 8 checks to the If a message is included. If not then it sets message to the default. Line 9 checks to the if there is a span listed (i.e. the cell data had a colon with something behind it. If so, line C Alls Tdout with the and the number of cells it spans. If not, line calls Tdout with just the message (Tdout'll set $colspan to the default 1). Lastly, we close out the row.
What This means are we can pass a single string to trout that would contain all of the necessary information to print out the E Ntire row as long as the "Celldata[:colspan]|celldata[:colspan]|......celldata[:colspan]" in the format.
So, instead of the ' all ' work we did before, the headers and body of the table could is called like this:
<TABLE>
?
$Theader->trout ("name:2| Address:3 ");
$Theader->trout ("first| Last| city| state/province| Country ");
$Tbody->trout ("rod| kreisler| Cortlandt| New york| USA ");
?>
</TABLE>
Wow. That ' s a lot easier. But What if the data is in variables? Simply Join the array:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.