Page 1 of 1

table auto-size (seemingly) not possible

Posted: Thu Mar 29, 2007 7:56 pm
by b0n3m4n
Sorry for posting this without having tried it on the latest beta, but I skimmed through the bug tracker items and haven't found it there.

I have trouble with setting a table to auto width. Now if I recall correctly, to do so, you just have to omit the width parameter. But doing so makes the resulting table lose its cellpadding information.

I think the error should be easily reproducible:

1) Content -> Pages -> New Page
2) Use the FCKEditor to generate a table using all the default values
3) Switch to Source Code editor
4) Remove the width = ... tag and set cellpadding to 100
5) Hit preview

For me the table now ignores the cellpadding although the resulting website is completely XHTML-validated. Have I missed an HTML parameter to set the table width on auto? AFAIK if you want it on auto you usually have to omit the width parameter, right?

I have no idea why this happens, as a plain html file with only the code displays correctly.

I don't even know if that can be considered a bug.

Here the code again for a quick test, just copy/paste it into a New Page window in CMSMS.


   
       
             
             
       
       
             
             
       
       
             
             
       
   

Re: table auto-size (seemingly) not possible

Posted: Fri Mar 30, 2007 8:03 am
by kermit
t is probably css "getting in the way", such as this, which i found at the top of one of the default stylesheets:

* {

margin:0;

padding:0;

}

and there was NO styling of tables or table elements elsewhere in that template's stylesheets... as soon as i fired up 'edit css' in the web developer toolbar and stuck td {padding:10px;} at the bottom of the css, i got padding in the cells.

so i guess the answer is, style the tables with css (at least as much as needed to override styles that already exist, and to replace any in-line formatting or styling that won't validate).. either overall (apply to all tables), based on your content div class or id (to limit that table css to just that container), or apply a class or id to the table itself (which you have to go into html view in fckeditor to do) to limit the css to just that table