首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

100分求给Table加属性,然后把它取出来,up有分,该怎么处理

2012-01-12 
100分求给Table加属性,然后把它取出来,up有分高分求给Table加属性,怎么加啊?up有分小弟现在要做个网站模板

100分求给Table加属性,然后把它取出来,up有分
高分求给Table加属性,怎么加啊?up有分

小弟现在要做个网站模板,现在选择了用FCKeditor做编辑器,FCKeditor里面有一个加表的,然后我这里因有特殊要求,所以要给Table   加几个属性,怎么加呢.例如加左边距,加离顶部的距离,加表的类型(因为我要跟据这个特殊类型的标识去创建点东东)
还有就是在保存的时候,我怎么样才可以把这类标识的表取出来,谢谢.

[解决办法]
没用过FCKeditor
沙发帮顶
[解决办法]
FCKEditor没用过!没办法帮你了!
[解决办法]
只能up了
[解决办法]
web form也不会,呵呵
[解决办法]
只能UP了
[解决办法]
那你用JS给表添加属性吧!
[解决办法]
专业路过 .

up 一下.
[解决办法]
在客户端
这是JS的问题吧
用js扩展几个属性就可以了

[解决办法]
没用过FCKeditor
sorry
[解决办法]
FCKeditor 呵呵 不知道是什么玩意~惭愧~!!!
[解决办法]
http://my.jcwcn.com/?23883/action_viewspace_itemid_8211
[解决办法]
加style就应该可以吧
[解决办法]
这东西 还没有用过,
[解决办法]
up给几分啊?
多up几下吧
up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up up
[解决办法]
!
[解决办法]
FCKeditor没用过,只能UP了
[解决办法]
up
[解决办法]
只能up了
[解决办法]
可以自己写FCKEditor的js扩展,不要它原来的插入表格,原理是一样的,新建一个html文件insertTable.htm,代码如下:
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN " >


<HTML>
<HEAD>
<META HTTP-EQUIV= "Expires " CONTENT= "0 ">
<title> 插入表格 </title>
<style>

body {
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
background: #ffffff;
width: 100%;
overflow:hidden;
border: 0;
}

body,tr,td {
color: #000000;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt;
}
</style>


<script language= "javascript ">
function returnTable()
{
var arr = new Array();

arr[ "width "] = document.getElementById( 'Width ').value;
arr[ "height "] = document.getElementById( 'Height ').value;
arr[ "cellpadding "] = document.getElementById( 'Cellpadding ').value;
arr[ "cellspacing "] = document.getElementById( 'Cellspacing ').value;
arr[ "border "] = document.getElementById( 'Border ').value;

arr[ "cols "] = document.getElementById( 'Columns ').value;
arr[ "rows "] = document.getElementById( 'Rows ').value;
arr[ "valigncells "] = document.getElementById( 'VAlignCells ')[document.getElementById( 'VAlignCells ').selectedIndex].value;
arr[ "haligncells "] = document.getElementById( 'HAlignCells ')[document.getElementById( 'HAlignCells ').selectedIndex].value;
arr[ "percentcols "] = document.getElementById( 'PercentCols ').checked;

arr[ "cellleft "]=document.getElementById( 'CellLeft ');
arr[ "cellright "]=document.getElementById( 'CellRight ');

window.returnValue = arr;
window.close();
}
</script>
</HEAD>
<body>
<table width=100% cellpadding=1 cellspacing=3 border=0>
<tr> <td valign=top>
<fieldset > <legend> 表格 </legend>
<table width=100% height=100% cellpadding=0 cellspacing=0 border=0>
<tr>
<td> 宽度 </td>
<td> <input type=text id= "Width " name= "Width " value=100 style= "width:50px; "> </td>
</tr> <tr>
<td> 高度 </td>
<td> <input type=text id= "Height " name= "Height " value=100 style= "width:50px; "> </td>
</tr> <tr>
<td> 单元格边距 </td>
<td> <input type=text id= "Cellpadding " name= "Cellpadding " style= "width:50px; " value=0> </td>
</tr> <tr>
<td> 单元格间距 </td>
<td> <input type=text id= "Cellspacing " name= "Cellspacing " style= "width:50px; " value=0> </td>
</tr> <tr>
<td> 边框粗细 </td>
<td> <input type=text id= "Border " name= "Border " style= "width:50px; " value=1> </td>
</tr>
</table>
</fieldset>
</td>
<td> &nbsp;&nbsp; </td>

<td valign=top>
<fieldset > <legend> 单元格 </legend>
<table width=100% height=100% cellpadding=0 cellspacing=0 border=0>
<tr>
<td> 列数 </td>
<td> <input type=text id= "Columns " name= "Columns " style= "width:80px; " value=2> </td>
</tr> <tr>
<td> 行数 </td>


<td> <input type=text id= "Rows " name= "Rows " style= "width:80px; " value=2> </td>
</tr> <tr>
<td> 垂直对齐方式 </td>
<td> <select id= "VAlignCells " name= "VAlignCells " style= "width:80px; ">
<option> 默认 </option>
<option value= "top "> 顶端对齐 </option>
<option value= "center "> 相对垂直居中 </option>
<option value= "bottom "> 相对底边对齐 </option>
</select>
</td>
</tr> <tr>
<td> 水平对齐方式 </td>
<td> <select id= "HAlignCells " name= "HAlignCells " style= "width:80px; ">
<option> 默认 </option>
<option value= "left "> 左对齐 </option>
<option value= "center "> 居中 </option>
<option value= "right "> 右对齐 </option>
</select>
</td>
</tr> <tr>
<td> 平均分配各列 </td>
<td> <input type= "checkbox " id= "PercentCols " name= "PercentCols " value= "1 "> </td>
</tr>
<tr>
<td> 左边距 </td>
<td> <input type= "text " id= "CellLeft " name= "CellLeft " /> </td>
</tr>
<tr>
<td> 右边距 </td>
<td> <input type= "text " id= "CellRight " name= "CellRight " /> </td>
</tr>
</table>
</fieldset>
</td> </tr>
<tr> <td colspan=3 align=center>
<input type= "button " onclick= "returnTable();return false; " value= "插入表格 ">
</td> </tr>
</table>
</body>
</html>
如下方式调用
//插入表格
function insertTable()
{debugger;
var tabSource=showModalDialog( 'insertTable.htm ', ' ', 'dialogWidth:400px;dialogHeight:400px;status:0;help:0 ');
if(undefined==tabSource)
{
return false;
}
var tab=document.createElement( 'table ');
var tab_body=document.createElement( 'tbody ');
var tdObjWidth;
if(tabSource.percentcols==true)
{
tdObjWidth=(100*1.0/parseInt(tabSource.cols))+ "% ";
}
tab.width=tabSource.width;
tab.height=tabSource.height;
tab.cellpadding=tabSource.cellpadding;
tab.cellspacing=tabSource.cellspacing;
tab.border=tabSource.border;
tab.style.align=tabSource.haligncells;
tab.style.valign=tabSource.valigncells;
//在此进行左边距和右边距的设置,代码如上几行
for(var i=0;i <parseInt(tabSource.rows);i++)
{
var tr_obj=document.createElement( 'tr ');
for(var j=0;j <parseInt(tabSource.cols);j++)
{
var td_obj=document.createElement( 'td ');
if(tabSource.percentcols==true)
{
td_obj.style.width=tdObjWidth;
}
td_obj.innerHTML= "&nbsp; ";
tr_obj.appendChild(td_obj);
}
tab_body.appendChild(tr_obj);
}
tab.appendChild(tab_body);
$( 'Editor ').innerHTML+=tab.outerHTML;//将生成的代码加到FCKEditor中
}
------解决方案--------------------


这个功能的实现关键是页面之间参数的传递,再一个就是动态生成表格对象并设置相关属性,可以网上搜索相关资料
[解决办法]
op
[解决办法]
up
[解决办法]
相当复杂!
[解决办法]
接分,谢谢。
[解决办法]
FCKEdtior中有一个示例,是关于js扩展的,也可看这个链接
http://www.cnblogs.com/matrix/archive/2007/04/16/714726.aspx
你的功能还是比较容易实现的!
[解决办法]
帮顶,学习一下
[解决办法]
up
[解决办法]
高手交流```菜鸟只能帮UP
[解决办法]
up
[解决办法]
up
[解决办法]
shit up
[解决办法]
路过 顶下……
[解决办法]
style属性好象不是这么用的吧,应该要用JAVA语言来实现!
[解决办法]
table是什么,是你生成的表格ID吗?如果不是ID你那么用是错误的。正确的用法是
document.getElementById( '表格id ').style.left= '80px ';
document.getElementById( '表格id ').style.width= '227px ';
...
...
...
[解决办法]
document.getElementById( '表格id ').style.left= '80px ';
document.getElementById( '表格id ').style.width= '227px ';
支持这种..
[解决办法]
路过~~
接点分了...
[解决办法]
有个叫做原型模式的模式,
[解决办法]
up
[解决办法]
继承一个table,加上自己的属性。
[解决办法]
可以这样试试:
通过tagName把所有该类对象取出来
var tables = document.getElementsByTagName( "TABLE ");
循环判断
for(var i = 0, l = tables.length; i < l; i++)
{
if (tables[i].style.left == '80px '){
//想要的操作,保存表格的话就取outerHTML
}
}
大概是这样,具体的可以自己根据情况处理。
[解决办法]
up
[解决办法]
http://my.jcwcn.com/?23883/action_viewspace_itemid_8211

[解决办法]
不懂,学习,帮顶,蹭点分。
[解决办法]
不懂js
[解决办法]
up...

热点排行