|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Print Table
I am finding that if I try and nest a table within a table using the print command the nested table is farmatted the same as the parent table even if you specify borders and colours within both of the table tags.
Example: print("<table width="400" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#990000">"); print("<TR>"); print("<TD"); print("<TABLE WIDTH="100%" border="0">n" ); |
|
#2
|
|||
|
|||
|
RE: Print Table
This sounds have nothing to do with the print command. Can you post up some full html that has this problem?
Check the source of this page...it is nothing but tables within tables..... Also, moving to Client side forum... |
|
#3
|
|||
|
|||
|
RE: Print Table
your third print statement does not have a ">" after the "D" in TD
|
|
#4
|
|||
|
|||
|
RE: Print Table
Thanks for that I am on holiday as from tomorrow and will not have time to check till I get back (weeks time) but will post my results...
|
|
#5
|
||||
|
||||
|
RE: Print Table
According to what I've discovered at http://www.richinstyle.com/ this is consistent behaviour. An element will take on the format of it's parent. In this case the second table is a child of the first table and will be formatted as per the parent.
Stylesheets are incredibly powerful but you do have to know what you are doing! |
|
#6
|
|||
|
|||
|
RE: Print Table
This adaptation of your code works:
<html> <body> <? print("<table width="400" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#990000">"); print("<TR>"); print("<TD align=center>"); print("<TABLE WIDTH="100" border="4" bordercolor="blue">n"); print("<TR>"); print("<TD width=50 align=center>Hello"); print("</TD>"); print("</TR>"); print("</Table>"); print("</TD>"); print("</TR>"); print("</Table>"); ?> </body> </html> You have to be careful of nesting. In HTML, tags need to be properly nested for them to behave properly. The code i've posted shows a new table inside another table, with different properties, notice blue border. If you are having problems of this sort, its always useful to view your page in a browser, right click the mouse, and choose view source. Save this, and validate it at: http://validator.w3.org/ Its an HTML validator, and will highlight any problems with the outputted HTML. |
|
#7
|
|||
|
|||
|
RE: Print Table
This adaptation of your code works:
<html> <body> <? print("<table width="400" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#990000">"); print("<TR>"); print("<TD align=center>"); print("<TABLE WIDTH="100" border="4" bordercolor="blue">n"); print("<TR>"); print("<TD width=50 align=center>Hello"); print("</TD>"); print("</TR>"); print("</Table>"); print("</TD>"); print("</TR>"); print("</Table>"); ?> </body> </html> You have to be careful of nesting. In HTML, tags need to be properly nested for them to behave properly. The code i've posted shows a new table inside another table, with different properties, notice blue border. If you are having problems of this sort, its always useful to view your page in a browser, right click the mouse, and choose view source. Save this, and validate it at: http://validator.w3.org/ Its an HTML validator, and will highlight any problems with the outputted HTML. |
|
#8
|
|||
|
|||
|
RE: Print Table
Thanks to all - My PHP was ok it was as some of you have said the fact that you have to be carefull when nesting the HTML and embarrassingly for me it was a mistake in my HTML and not nesting the HTML correctly as well as missing out a ">" - thanks Evilive....
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > Print Table |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|