When inserting table either using fckeditor table insert or table created by Dreamveawer, and put a FIXED table width (px), the table always become 100%.

1. I don't see any CSS in my theme that would overide table display.
2. When viewing the HTML page created, the table width is still has the fixed value entered, but the actual display is 100%
3. I also tested in garland and framework theme with no success.
4. I found this http://drupal.org/node/105772, but no solution there and it was old and not being put as fckeditor issues.

Thanks !

Comments

Jorrit’s picture

Status: Active » Postponed (maintainer needs more info)

Can you give a link to the page that shows this?

najibx’s picture

Hmm ... it seems that the theme CSS related to table (table, th, tr, td) would take over the table inside the FCKEditor area. Even in garland theme. Any way, we can somehow "wrap" the actual content being display but still want the theme CSS for display, and use different CSS for content from FCKEditor?

The CSS settings selection - use theme CSS, define CSS, FCKeditor default, is for displaying the textarea for editing content, not the ACTUAL content being display, am i correct ? So this does not help.


table {
  margin: 1em 0;
  width: 100%;     // THIS CAUSE THE ALL TABLE BECOME 100%
}

thead th {
  border-bottom: 2px solid #d3e7f4;
  color: #494949;
  font-weight: bold;
}

th a:link, th a:visited {
  color: #6f9dbd;
}

td, th {
  padding: .3em .5em;   
}

tr.even, tr.odd, tbody th {
  border: solid #d3e7f4;
  border-width: 1px 0;
}

najibx’s picture

Title: table width display is ignored and become 100% » table settings created in FCKEditor is overiden by theme's CSS
Jorrit’s picture

Somehow it would be nice if the table width would be given as a css style instead of the width property. I don't know if that can be done.

najibx’s picture

Do you mean table width/settings in FCKEditor display? In our case, we have another team who uses dreamweaver to create a content with table, and then simply copy & paste in FCKEditor, so it's more straight forward to use width property.

allcelldeals’s picture

Anyone come up with an answer to this? I need to use tables but the theme keeps changing it to 100%. Getting ready to rip my hair out.

najibx’s picture

Version: 5.x-2.2-rc1 » 6.x-2.x-dev

allcelldeals ...

do you anything like below in your theme's CSS?

table {
width: 100%; // THIS CAUSE THE ALL TABLE BECOME 100%
}

I'm still wondering if general table, tr, td etc shall be disable. Instead, use class or ID for more specific.
This way, CSS table's setting will not disturb table in FCKeditor. But aren't there many classes for table that I need to cover?
such as views-table, table ID "blocks" for admin ....

Jorrit’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Closed because of lack of activity.

bassplaya’s picture

Status: Closed (fixed) » Active

I have the same issue. The width of the table is set to 100% by the html-elements.css (Zen theme). That is actually very nice to set it at 100% but you want to use FCK Editor to allow the user to create their own width for their table, right? So deleting that one line of 100% is going to make all your tables site wide look ugly. So narrowing down with a css rule would be a good option but there's no way you can remove that table {width:100%} however you can set it to table {width: auto;} but that will result in a similar issue by creating a width relative to the amount of content in the table and not the set width by the user's input through FCK Editor. If however we delete this statement of 100% width in firebug the correct table width shows.. the best way to solve this issue here would be to apply inline styles:
<table style="width:200px">
because that DOES override the external styles.
So, how do we do this without bothering the user who doesn't have the knowledge of CSS whatsoever?

tolaemon’s picture

I also had a similar problem with FCKEditor and the width of the tables, and solved it removing the line "width: 100%;" in Garland's style.css file.

table {
margin: 1em 0;
width: 100%; <=== Removed this line
}

I supose that this line was there for some reason, but I removed it and haven't had any problem. Maybe problems apear when using other modules.

Jorrit’s picture

Status: Active » Closed (fixed)

I think all has been said about table widths.

nehaish’s picture

Priority: Normal » Critical
Status: Closed (fixed) » Active

Hi,

My name is neha. I'm using fckeditor with asp.net2.0. I want to restrict user for table width in fckeditor.
suppose i want to restrict the user that he won't be able to add table using fckeditor of width more than 500px. How can i do this?

Since there are two ways of adding tables using fckeditor:
1. insert table from fckeditor.
2. Adding Html code using "source" button in fckeditor

So i need to restrict user from both the ways.
Also the html data from the source of fckeditor needs to be saved in database. So what i need is suppose user has set the table width to 600px then it will change to width=500px and the new changed width i.e 500px will get saved in database.

So this needs to be done from both above mentioned perspectives.
Its really urgent. Can anybody help me regarding this?

Thanks,
Neha

Jorrit’s picture

Status: Active » Closed (fixed)

Well, this is a Drupal related issue tracker and Drupal runs on PHP, not ASP.NET 2.0. So please try your question elsewhere.

alfthecat’s picture

Version: 6.x-2.x-dev » 6.x-2.1
Category: support » bug
Status: Closed (fixed) » Active

Hi,

I'm sorry to re-open this again, but off course I have the same problem. It does not matter what theme I use thought, FCK editor always ignores the width definitions.

This is especially awkward for newsletters sent out in full html. I also tried using a html editor (Expression Web) to draw up the tables with no result.

Any thoughts on this, or indications as to when this bug may get fixed?

Thanks!

Jorrit’s picture

For newsletters it's strange, because it doesn't use the Drupal system CSS, I think. Please check if your filter doesn't remove the width definition by comparing the html source of the newsletter with your input.

Jorrit’s picture

Status: Active » Closed (fixed)