Greetings All!<br />
<br />
Can anyone help me with HTML table layout.<br />
<br />
I have a problem with one table on my site.<br />
<br />
It is at <!-- w --><a class="postlink" href="http://www.karsites.net">www.karsites.net</a><!-- w -->. Under the King's Lynn & Villages Mutual Exchange Register button.<br />
<br />
If you click on <Advanced Search for a Property Exchange> button, and take a look at the end of the search form. <br />
<br />
I have tried removing the colons from the text before the drop-down option buttons, to no avail. <br />
<br />
The browser insists on wrapping the text before the button. I want to display the text followed by the option button all on one line. <br />
<br />
The other problem is the browser insists on making the table wider than the sceen, when there is no need. <br />
I want the table the same width as the first part - which is a seperate table.<br />
<br />
Any suggestions would be wellcome.<br />
<br />
I would like to get HTML table layout working, withoyt having to resort to CSS just yet.<br />
<br />
<br />
Kind Regards - Jabez<!--content-->I do not see what you mean but I do see the browser a large vertical scroll bar that is there for no reason. How about you put inbetween each word, it will not wrap then because nbsp is non breaking space. There is something called nowrap, but do not use it, its deprecated.<!--content-->The HTML on that page is so totally screwed up I'm surprised it renders at all.<!--content-->nothing suprises me anymore :/ I have seen plenty of butchered sites, I do the clan's and guilds section on dmoz.org so its like every kid with a clan that started 3 days ago went to goodies and through something together and sent it to me... they all have horrid midi background music too. <!--content-->Here is the butchered code!<br />
<br />
I tried to Validate it at W3C, but it broke the Validator!<br />
<br />
Keith Roberts<!--content-->Can't comment on the php seeing as I do not use that, but it is a table based layout with no doc type which is undesireabl in my opinion, but maybe this company is a harlot that does not care about cross platform compadability or saving bandwidth.<!--content-->Hi PeOfEo.<br />
<br />
I have found a way to format the table now.<br />
<br />
The form is in a php4 include file, not a stand-alone php script as such.<br />
<br />
(I just include the form code where needed, and call the php4 function it lives in).<br />
<br />
I have tried to validate it, by adding the required DOC-TYPE and meta-data to the latest version of the code.<br />
<br />
The validator DOES NOT like my php code.<br />
<br />
The validator also complains about COLSPAN="nn%".<br />
<br />
Apparently, percentages are not valid in a COLSPAN.<br />
<br />
If I try and use <TH WIDTH="NN%"> it won't do what I want it to.<br />
<br />
So I can get the table layout the way I want it to be now, but it won't validate properly!<br />
<br />
Below is a copy of the code that is now working.<br />
<br />
Please note the invalid COLSPAN syntax, that actually does work, but will not validate.<br />
<br />
Kind Regards - Keith Roberts<br />
<br />
PS this new code will not be seen on my website yet, as it is in a different test directory.<br />
<br />
Also, if you view the live website code, you will see a scrambled version of my php/html code - probably why it looks such a mess! <br />
<br />
You will see that all php function names are replaced with f_nnn, and php variables with v_nnn. Also each script is ONE long line, as all EOL have been stripped out from the code.<br />
<br />
Also all comments have been stripped out too.<!--content-->In your HTML use " " not ' ' (see <TABLE tags>)<br />
<br />
No ending </td>'s or </tr>'s<br />
<br />
Errors in colspan=xx.<br />
This is for the number of columns spanned NOT a percentage of screen width <br />
and the number of columns MUST match for each <TR><br />
ie:<br />
<tr><td>...</td><td>...</td><td>...</td></tr><br />
<tr><td colspan=2>...</td><td>...</td></tr><br />
<tr><td colspan=3>..</td></tr><br />
<br />
If you want to set column widths, use...<br />
<td width="20%"> <br />
<br />
I suggest you create an HTML page with the desired table layout (not using PHP) and<br />
validate that. Then insert the code back into your PHP script. Might save you a lot of headaches.<!--content-->Hi Nedals.<br />
<br />
Thanks for the helpful comments and suggestions.<br />
<br />
I thought that the closing </tr> </th> </td> tags were implied by starting a new opening one, as in <P> tags.<br />
<br />
Also I did not realise that the number of columns MUST be the same for each row.<br />
<br />
Validating the HTML table code seperately from the PHP code sounds a good idea.<br />
<br />
I shall get on with re-writing my tables, and post an updated version when ok. Maybe several days yet though.<br />
<br />
Thanks again for your help.<br />
<br />
Kind Regards - Keith Roberts<!--content-->A quick read though the HTML 4.01 specs, <!-- m --><a class="postlink" href="http://www.w3.org/TR/html401/">http://www.w3.org/TR/html401/</a><!-- m -->, indicates that the end tags are indeed optional. However, in the early days, NS would not correctely render a table without the end tags. I've used them ever since. It would not supprise me if other browsers mess up with missing end tags.<br />
<br />
You should also use an </p> tag. Again, they are optional but I highly recomend you include them.<!--content-->I have just applied your suggestions to one of my forms.<br />
<br />
As a work around I have changed<br />
<br />
COLGROUP SPAN=100 WIDTH="1%"<br />
<br />
So each table row is now 100 columns wide.<br />
<br />
Here is the latest version. <br />
<br />
NB there are still a few rows where COLSPAN=90. I shall finish tidying-up this test table tommorow.<br />
<br />
Next job is add DOC-TYPE and some meta tags, add see if I can get the form to validate properly at W3C.<br />
<br />
Thankyou. <br />
<br />
Kind Regards - Keith Roberts<!--content-->I took the liberty of re-writing your table.<br />
You really don't need 100 columns. Only 4 are required. <br />
<br />
Comments:<br />
* Get rid of all those 'spacer' lines. They are unnecessary and will slow down your site.<br />
* Took out a lot of unnecessary <br> tags<br />
* Added "" to several "center"<br />
* <option> uses 'selected' not 'checked'. In this case you don't need it because the first option is selected by default.<br />
* Removed 'align=left'. It's the default.<br />
* <A NAME='end'</A> missing an end >. What does it do anyway?<br />
<br />
Add a DTD and it should validate.<br />
<br />
Hope this helps. <!--content-->Hi Nedals.<br />
<br />
Thankyou for your comments and help.<br />
<br />
I cannot Download <!--more--> the form you have reworked for me.<br />
<br />
Can you email it to me please, to <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->.<br />
<br />
<br />
The end tag was'nt meant to be there.<br />
<br />
Thanks Keith Roberts<!--content-->Originally posted by Keith Roberts <br />
I cannot Download <!--more--> the form you have reworked for me.<br />
Very odd?<br />
Click on link, save to your desktop, and change the name to an '.html' file. It works OK for me.<!--content-->Hi Nedals.<br />
<br />
I'm using Konqueror browser in KDE under Linux.<br />
<br />
When I click on the attachment, Konqueror opens another browser window.<br />
<br />
I then get the following error message in a pop-up box:<br />
<br />
Could not create view for unknown/unknown.<br />
<br />
Possibly have to tinker with file associations in the Konqueror browser.<br />
<br />
Regards - Keith Roberts<br />
<br />
<!--content-->
<br />
Can anyone help me with HTML table layout.<br />
<br />
I have a problem with one table on my site.<br />
<br />
It is at <!-- w --><a class="postlink" href="http://www.karsites.net">www.karsites.net</a><!-- w -->. Under the King's Lynn & Villages Mutual Exchange Register button.<br />
<br />
If you click on <Advanced Search for a Property Exchange> button, and take a look at the end of the search form. <br />
<br />
I have tried removing the colons from the text before the drop-down option buttons, to no avail. <br />
<br />
The browser insists on wrapping the text before the button. I want to display the text followed by the option button all on one line. <br />
<br />
The other problem is the browser insists on making the table wider than the sceen, when there is no need. <br />
I want the table the same width as the first part - which is a seperate table.<br />
<br />
Any suggestions would be wellcome.<br />
<br />
I would like to get HTML table layout working, withoyt having to resort to CSS just yet.<br />
<br />
<br />
Kind Regards - Jabez<!--content-->I do not see what you mean but I do see the browser a large vertical scroll bar that is there for no reason. How about you put inbetween each word, it will not wrap then because nbsp is non breaking space. There is something called nowrap, but do not use it, its deprecated.<!--content-->The HTML on that page is so totally screwed up I'm surprised it renders at all.<!--content-->nothing suprises me anymore :/ I have seen plenty of butchered sites, I do the clan's and guilds section on dmoz.org so its like every kid with a clan that started 3 days ago went to goodies and through something together and sent it to me... they all have horrid midi background music too. <!--content-->Here is the butchered code!<br />
<br />
I tried to Validate it at W3C, but it broke the Validator!<br />
<br />
Keith Roberts<!--content-->Can't comment on the php seeing as I do not use that, but it is a table based layout with no doc type which is undesireabl in my opinion, but maybe this company is a harlot that does not care about cross platform compadability or saving bandwidth.<!--content-->Hi PeOfEo.<br />
<br />
I have found a way to format the table now.<br />
<br />
The form is in a php4 include file, not a stand-alone php script as such.<br />
<br />
(I just include the form code where needed, and call the php4 function it lives in).<br />
<br />
I have tried to validate it, by adding the required DOC-TYPE and meta-data to the latest version of the code.<br />
<br />
The validator DOES NOT like my php code.<br />
<br />
The validator also complains about COLSPAN="nn%".<br />
<br />
Apparently, percentages are not valid in a COLSPAN.<br />
<br />
If I try and use <TH WIDTH="NN%"> it won't do what I want it to.<br />
<br />
So I can get the table layout the way I want it to be now, but it won't validate properly!<br />
<br />
Below is a copy of the code that is now working.<br />
<br />
Please note the invalid COLSPAN syntax, that actually does work, but will not validate.<br />
<br />
Kind Regards - Keith Roberts<br />
<br />
PS this new code will not be seen on my website yet, as it is in a different test directory.<br />
<br />
Also, if you view the live website code, you will see a scrambled version of my php/html code - probably why it looks such a mess! <br />
<br />
You will see that all php function names are replaced with f_nnn, and php variables with v_nnn. Also each script is ONE long line, as all EOL have been stripped out from the code.<br />
<br />
Also all comments have been stripped out too.<!--content-->In your HTML use " " not ' ' (see <TABLE tags>)<br />
<br />
No ending </td>'s or </tr>'s<br />
<br />
Errors in colspan=xx.<br />
This is for the number of columns spanned NOT a percentage of screen width <br />
and the number of columns MUST match for each <TR><br />
ie:<br />
<tr><td>...</td><td>...</td><td>...</td></tr><br />
<tr><td colspan=2>...</td><td>...</td></tr><br />
<tr><td colspan=3>..</td></tr><br />
<br />
If you want to set column widths, use...<br />
<td width="20%"> <br />
<br />
I suggest you create an HTML page with the desired table layout (not using PHP) and<br />
validate that. Then insert the code back into your PHP script. Might save you a lot of headaches.<!--content-->Hi Nedals.<br />
<br />
Thanks for the helpful comments and suggestions.<br />
<br />
I thought that the closing </tr> </th> </td> tags were implied by starting a new opening one, as in <P> tags.<br />
<br />
Also I did not realise that the number of columns MUST be the same for each row.<br />
<br />
Validating the HTML table code seperately from the PHP code sounds a good idea.<br />
<br />
I shall get on with re-writing my tables, and post an updated version when ok. Maybe several days yet though.<br />
<br />
Thanks again for your help.<br />
<br />
Kind Regards - Keith Roberts<!--content-->A quick read though the HTML 4.01 specs, <!-- m --><a class="postlink" href="http://www.w3.org/TR/html401/">http://www.w3.org/TR/html401/</a><!-- m -->, indicates that the end tags are indeed optional. However, in the early days, NS would not correctely render a table without the end tags. I've used them ever since. It would not supprise me if other browsers mess up with missing end tags.<br />
<br />
You should also use an </p> tag. Again, they are optional but I highly recomend you include them.<!--content-->I have just applied your suggestions to one of my forms.<br />
<br />
As a work around I have changed<br />
<br />
COLGROUP SPAN=100 WIDTH="1%"<br />
<br />
So each table row is now 100 columns wide.<br />
<br />
Here is the latest version. <br />
<br />
NB there are still a few rows where COLSPAN=90. I shall finish tidying-up this test table tommorow.<br />
<br />
Next job is add DOC-TYPE and some meta tags, add see if I can get the form to validate properly at W3C.<br />
<br />
Thankyou. <br />
<br />
Kind Regards - Keith Roberts<!--content-->I took the liberty of re-writing your table.<br />
You really don't need 100 columns. Only 4 are required. <br />
<br />
Comments:<br />
* Get rid of all those 'spacer' lines. They are unnecessary and will slow down your site.<br />
* Took out a lot of unnecessary <br> tags<br />
* Added "" to several "center"<br />
* <option> uses 'selected' not 'checked'. In this case you don't need it because the first option is selected by default.<br />
* Removed 'align=left'. It's the default.<br />
* <A NAME='end'</A> missing an end >. What does it do anyway?<br />
<br />
Add a DTD and it should validate.<br />
<br />
Hope this helps. <!--content-->Hi Nedals.<br />
<br />
Thankyou for your comments and help.<br />
<br />
I cannot Download <!--more--> the form you have reworked for me.<br />
<br />
Can you email it to me please, to <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->.<br />
<br />
<br />
The end tag was'nt meant to be there.<br />
<br />
Thanks Keith Roberts<!--content-->Originally posted by Keith Roberts <br />
I cannot Download <!--more--> the form you have reworked for me.<br />
Very odd?<br />
Click on link, save to your desktop, and change the name to an '.html' file. It works OK for me.<!--content-->Hi Nedals.<br />
<br />
I'm using Konqueror browser in KDE under Linux.<br />
<br />
When I click on the attachment, Konqueror opens another browser window.<br />
<br />
I then get the following error message in a pop-up box:<br />
<br />
Could not create view for unknown/unknown.<br />
<br />
Possibly have to tinker with file associations in the Konqueror browser.<br />
<br />
Regards - Keith Roberts<br />
<br />
<!--content-->