![]() |
|
|
|
#1 |
|
If I specify a border for the table, the specified column width is honored
when displayed in my browser. But I don't understand why the column widths are not obeyed when the table's border is zero: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder V6.0.2 for Windows"> <META http-equiv="Content-Style-Type" content="text/css"> <TITLE></TITLE> <BODY> <DIV align='left'> <TABLE cellspacing="0" width="100%" cellpadding="0" border="0"> <COL span="1" width="100"> <COL span="1" width="20"> <COL span="1" width="100"> <COL span="1" width="20"> <COL span="1" width="100"> <COL span="1" width="20"> <TBODY> <TR align="left" bgcolor="#cccccc"> <TD><FONT face="Arial" size="2">Date</FONT></TD> <TD></TD> <TD><FONT face="Arial" size="2">Order No.</FONT></TD> <TD></TD> <TD><FONT face="Arial" size="2">Payment Ref.</FONT></TD> <TD></TD> <TD></TD> </TR> </TBODY> </TABLE> </DIV> </BODY> Does anyone know why this happens? Thank you. -- ELKNews FREE Edition - Empower your News Reader! http://www.atozedsoftware.com Fernie |
|
|
|
|
#2 |
|
Posts: n/a
|
Fernie wrote: > If I specify a border for the table, the specified column width is honored > when displayed in my browser. But I don't understand why the column widths > are not obeyed when the table's border is zero: <snip> I'd get used to validating your code, I like this one: http://validator.w3.org/ Does this do what you want? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> body{ width: 100%; border: 0; padding: 0; margin: 0; } ..wrapper{ text-align: left; } ..t1{ border: 0; padding: 0; width: 100%; border-spacing: 0; } ..td1{ font-family: Arial; font-size: 90%; } </style> <TITLE>table</TITLE> </head> <BODY> <DIV class='wrapper'> <TABLE class='t1'> <COL span="1" width="100"> <COL span="1" width="20"> <COL span="1" width="100"> <COL span="1" width="20"> <COL span="1" width="100"> <COL span="1" width="20"> <TBODY> <TR align="left" bgcolor="#cccccc"> <TD class='td1'>Date</TD> <TD> </TD> <TD class='td1'>Order No.</TD> <TD> </TD> <TD class='td1'>Payment Ref.</TD> <TD> </TD> <TD> </TD> </TR> </TBODY> </TABLE> </DIV> </BODY> </html> |
|
|
|
#3 |
|
Posts: n/a
|
your column widths are not applied due to the fact that <COL span="1"
width="100"> does not exist. try putting (eg: <td colspan="1" width="100"> insead of the <COLS... . This should sort your problem. From si Fernie wrote: > If I specify a border for the table, the specified column width is honored > when displayed in my browser. But I don't understand why the column widths > are not obeyed when the table's border is zero: > > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> > <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> > <META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder V6.0.2 > for Windows"> > <META http-equiv="Content-Style-Type" content="text/css"> > <TITLE></TITLE> > <BODY> > <DIV align='left'> > <TABLE cellspacing="0" width="100%" cellpadding="0" border="0"> > <COL span="1" width="100"> > <COL span="1" width="20"> > <COL span="1" width="100"> > <COL span="1" width="20"> > <COL span="1" width="100"> > <COL span="1" width="20"> > <TBODY> > <TR align="left" bgcolor="#cccccc"> > <TD><FONT face="Arial" size="2">Date</FONT></TD> > <TD></TD> > <TD><FONT face="Arial" size="2">Order No.</FONT></TD> > <TD></TD> > <TD><FONT face="Arial" size="2">Payment Ref.</FONT></TD> > <TD></TD> > <TD></TD> > </TR> > </TBODY> > </TABLE> > </DIV> > </BODY> > > Does anyone know why this happens? Thank you. > > > > -- > > ELKNews FREE Edition - Empower your News Reader! http://www.atozedsoftware.com |
|
|
|
#4 |
|
Posts: n/a
|
Simon Woodcock <> wrote:
>your column widths are not applied due to the fact that <COL span="1" >width="100"> does not exist. Hmm, let's see someone who top posted claims that a perfectly legit HTML construction doesn't exist. I guess that you couldn't be bothered to check the HTML spec any more than you could be bothered to check the posting convetion in this newsgroup. Steve -- "My theories appal you, my heresies outrage you, I never answer letters and you don't like my tie." - The Doctor Steve Pugh <> <http://steve.pugh.net/> |
|
|
|
#5 |
|
Posts: n/a
|
Steve Pugh ... output:
> Simon Woodcock <> wrote: > >>your column widths are not applied due to the fact that <COL span="1" >>width="100"> does not exist. > > Hmm, let's see someone who top posted claims that a perfectly legit > HTML construction doesn't exist. I guess that you couldn't be bothered > to check the HTML spec any more than you could be bothered to check > the posting convetion in this newsgroup. urk... a) <colgroup span="3"> is something different than <col span="3">. b) When you use <thead>, <tfoot> or <tbody> you have to use them always together. c) When you predefine six <col> tags in the <colgroup> section then don't use seven <td>..</td> pairs in the <tbody>. d) When a), b) and c) are obeyed then there is no difference when you use border="0" or ="[>0]". e) When you use width="100%" or width="700" in the <table> tag then width="20" and width="100" is relative but if there is no 'width' attribute in the <table> tag then width="20" or width="100" in the <col> tag is absolute. http://html.janfaerber.com/tables/border.lsd -- Jan http://html.janfaerber.com |
|