Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
1) I create a new page
2) For input format I select full htmls
3) I insert a table
4) But when the table displays, the width seems to "expand" to fit the page (despite the html code)
If you wanted width 100%, the contents columns should be 50%, each, not 100, do your maths
height=100% will not work very consistantly over browsers
Basically, you've got a lot of fiddling to do to learn best practices for HTML these days.
Check your actual html source that gets output to the page, I don't trust wysiwyg, and if anything, if it's really stripping any parameters, this issue should be posted to the respective wysiwyg module project.
Is that code what you think you've entered, or what actually gets sent to your view-source? Sometimes output filters get in the way and strip away bits you expect to see.
Your maths is still screwy in that code you pasted. There can be times when you want to mix & match absolute pixels and dodgy percentages, but that requires a bit of code-fu.
You are theoretically wanting the tds to be 5% of their containing layout element - which is the table itself. you are asking for 5% of 15 pixels. - 3/4 of 1 pixel.
No, that doesn't work either, but you've got bigger problems. Check some HTML handbooks, alistapart has the guru articles.
Save a static html version of the page and tweak that by hand until you've solved it
Only then take it back and see if it's Drupal or the wysiwyg that may be causing you problems
As it turns out, the problem wasn't with the code. It was with the theme. As soon as I switched to Marvin it worked. Switching back to Garland produced the strange behavior (resizing tables to full size). Just curious . . . .why does the html work with only certain themes?
along with the theme html comes theme css.
Sometimes that theme css may conflict with what you are wanting.
eg if Garland/style.css has table{width:100%} or something more mysterious with the position or float of containing elements, it requires fiddling.
That said - your hard-coding of a width into a table html should have over-ridden all css.
Use "View Styles" to track down which rules are in effect for your trouble spots.
Comments
not a good start
that HTML is wrong in several ways.
100%
not100
(pixels)height=100%
will not work very consistantly over browsersBasically, you've got a lot of fiddling to do to learn best practices for HTML these days.
Check your actual html source that gets output to the page, I don't trust wysiwyg, and if anything, if it's really stripping any parameters, this issue should be posted to the respective wysiwyg module project.
.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/
.dan. is the New Zealand Drupal Developer working on Government Web Standards
Tried your suggestion - Still no luck
Despite de-activating the wysiwyg editor and using the code below, my table still "expands" to fill the entire page:
Any other ideas? Seems like strange behavior.
Keep reading the guides
Is that code what you think you've entered, or what actually gets sent to your view-source? Sometimes output filters get in the way and strip away bits you expect to see.
Your maths is still screwy in that code you pasted. There can be times when you want to mix & match absolute pixels and dodgy percentages, but that requires a bit of code-fu.
You are theoretically wanting the tds to be 5% of their containing layout element - which is the table itself. you are asking for 5% of 15 pixels. - 3/4 of 1 pixel.
No, that doesn't work either, but you've got bigger problems. Check some HTML handbooks, alistapart has the guru articles.
Save a static html version of the page and tweak that by hand until you've solved it
Only then take it back and see if it's Drupal or the wysiwyg that may be causing you problems
.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/
.dan. is the New Zealand Drupal Developer working on Government Web Standards
Thanks Dan
As it turns out, the problem wasn't with the code. It was with the theme. As soon as I switched to Marvin it worked. Switching back to Garland produced the strange behavior (resizing tables to full size). Just curious . . . .why does the html work with only certain themes?
Thanks for your help Dan.
Josh
css cascades
along with the theme html comes theme css.
Sometimes that theme css may conflict with what you are wanting.
eg if Garland/style.css has
table{width:100%}
or something more mysterious with the position or float of containing elements, it requires fiddling.That said - your hard-coding of a width into a table html should have over-ridden all css.
Use "View Styles" to track down which rules are in effect for your trouble spots.
.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/
.dan. is the New Zealand Drupal Developer working on Government Web Standards
Thanks
Thanks Dan.