I meant the default size of a table created by the table tool, when the "new table" dialog opens it default to 200px width, I'd like to have a 100% width.
Thank you Daniel Hum... I'm the only one to think that this should be turned into a FCKConfig setting, so that the above modification does not need to be done every time we upgrade the library?
No, you're right. I've done quite alot of this kind of modifications myself, and I'm really afraid to start upgrading to RC3 at the end of this month, and to the final stable release lateron this year.
I really hope all this kind of stuff can be set through one or more config files
Hi there, I know this is an old thread but we are wanting to do something similar. Basically have defaults in the insert table and insert image functions. We could use CSS but actually we don't want all images and tables to behave in the way we wish for them to behave - only those added by content editors.
For example, we would like for the cell-aligment in a table to be 'top' by default. We could change the fck_editorarea.css like so: td { vertical-align: top; } but this only impacts on edit area and when the table is published the cell's will follow whatever other CSS is in play.
We could have a class specially for FCKeditor tables but then the problem is that if a user wishes to change the vertical alignment they will need to understand what a class is as opposed to going cell->alignment->top.
So the best solution for us is if when a table is inserted we have control over the default cell properties which then means that the HTML is inserted with: <td valign=”top”>cell content</td>
Then the user can turn it off if they wish but it has defaulted to what they would prefer.
For images we are interested in something equivalent to: img { float: left; margin: 15px; }
I've looked at the fck_table.html "200" width solution above but I don't think this will do what we need because these values are "undefined" or "unset" by default so there is no "200" string to search for.
RE: Table defaults
but I've modified the FCKeditor constructor in fckeditor.php file in the main FCKeditor directory as follows:
function FCKeditor( $instanceName, $width, $height)
{
$this->InstanceName = $instanceName ;
$this->BasePath = '/FCKeditor/' ;
$this->Width = $width;
$this->Height = $height;
$this->ToolbarSet = 'Default' ;
$this->Value = '' ;
$this->Config = array() ;
}
then in the script I use to build & show the actual editor, I've changed the function call to:
$oFCKeditor = new FCKeditor('editor', "100%", "100%");
to get the editor full width & height.
RE: Table defaults
RE: Table defaults
oh okay ...
Then you should go to the dialog directory in the main FCKeditor directory.
you'll find a file called fck_table.html
do a search on "200" and you'll find exactly 1 occurance: the default 200 px width.
<tr>
<td><span fckLang="DlgTableWidth">Width</span>:</td>
<td> <input id="txtWidth" type="text" maxLength="4" size="3" value="200" name="txtWidth" onkeypress="return IsDigit(event);"></td>
<td> <select id="selWidthType" name="selWidthType">
<option fckLang="DlgTableWidthPx" value="pixels" selected>pixels</option>
<option fckLang="DlgTableWidthPc" value="percent" >percent</option>
</select></td>
</tr>
Change to:
<tr>
<td><span fckLang="DlgTableWidth">Width</span>:</td>
<td> <input id="txtWidth" type="text" maxLength="4" size="3" value="100" name="txtWidth" onkeypress="return IsDigit(event);"></td>
<td> <select id="selWidthType" name="selWidthType">
<option fckLang="DlgTableWidthPx" value="pixels" >pixels</option>
<option fckLang="DlgTableWidthPc" value="percent" selected>percent</option>
</select></td>
</tr>
that should do it
Don't forget to clear your cache before reloading.
RE: Table defaults
Thank you Daniel
Hum... I'm the only one to think that this should be turned into a FCKConfig setting, so that the above modification does not need to be done every time we upgrade the library?
RE: Table defaults
I really hope all this kind of stuff can be set through one or more config files
Re: Table defaults
I know this is an old thread but we are wanting to do something similar. Basically have defaults in the insert table and insert image functions.
We could use CSS but actually we don't want all images and tables to behave in the way we wish for them to behave - only those added by content editors.
For example, we would like for the cell-aligment in a table to be 'top' by default. We could change the fck_editorarea.css like so:
td { vertical-align: top; }
but this only impacts on edit area and when the table is published the cell's will follow whatever other CSS is in play.
We could have a class specially for FCKeditor tables but then the problem is that if a user wishes to change the vertical alignment they will need to understand what a class is as opposed to going cell->alignment->top.
So the best solution for us is if when a table is inserted we have control over the default cell properties which then means that the HTML is inserted with:
<td valign=”top”>cell content</td>
Then the user can turn it off if they wish but it has defaulted to what they would prefer.
For images we are interested in something equivalent to: img { float: left; margin: 15px; }
I've looked at the fck_table.html "200" width solution above but I don't think this will do what we need because these values are "undefined" or "unset" by default so there is no "200" string to search for.
Thank you kindly for your assistance,
r
Re: Table defaults
fyi:
https://dev.fckeditor.net/ticket/2339