HTML高级应用
2006-11-30 09:43
253 查看
通过js遍历html对象的属性
function popUpProperties(inobj) {
op = window.open();
op.document.open('text/plain');
for (objprop in inobj) {
op.document.write(objprop + ' 的属性或方法: ' + inobj[objprop] + '\n');
}
op.document.close();
}
Table的单元格保持宽度不变
代码如下: 关键是两个属性 1)word-wrap
2)word-break
以及标签 <wbr>
他能在需要换行的时候自动变作换行操作
<TABLE border="1" width="200" style="table-layout:fixed;">
<TR>
<TD>dfad</TD>
<TD style="width:100;word-wrap:break-word">
testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttest</TD>
</TR>
</TABLE>
<TABLE border="1" width="200" style="table-layout:auto;">
<TR>
<TD>dfad</TD>
<TD style="width:100;word-wrap:break-word;word-break:break-all; ">
testtesttesttesttesttest<wbr>testtesttesttesttest<wbr>testtesttesttesttest</TD>
</TR>
</TABLE>
select元素的动态添加
<SCRIPT LANGUAGE="JScript">
var oOption = document.createElement("OPTION");
oOption.text="Ferrari";
oOption.value="4";
oSelect.add(oOption);
</SCRIPT>
function popUpProperties(inobj) {
op = window.open();
op.document.open('text/plain');
for (objprop in inobj) {
op.document.write(objprop + ' 的属性或方法: ' + inobj[objprop] + '\n');
}
op.document.close();
}
Table的单元格保持宽度不变
代码如下: 关键是两个属性 1)word-wrap
2)word-break
以及标签 <wbr>
他能在需要换行的时候自动变作换行操作
<TABLE border="1" width="200" style="table-layout:fixed;">
<TR>
<TD>dfad</TD>
<TD style="width:100;word-wrap:break-word">
testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttest</TD>
</TR>
</TABLE>
<TABLE border="1" width="200" style="table-layout:auto;">
<TR>
<TD>dfad</TD>
<TD style="width:100;word-wrap:break-word;word-break:break-all; ">
testtesttesttesttesttest<wbr>testtesttesttesttest<wbr>testtesttesttesttest</TD>
</TR>
</TABLE>
select元素的动态添加
<SCRIPT LANGUAGE="JScript">
var oOption = document.createElement("OPTION");
oOption.text="Ferrari";
oOption.value="4";
oSelect.add(oOption);
</SCRIPT>
相关文章推荐
- HTML教程-HTML技巧-层的高级应用
- HTML高级标签之表单应用(一)
- html中有序列表标签ol,li的高级应用
- HTML input文本框 高级应用
- JAVA遇见HTML—Servlet篇(二.Servlet高级-应用MVC架构实现购物车Demo+JSP)
- 第三章html高级应用2
- HTML高级标签(3)————表单的应用
- html input高级应用
- 第三章html表单的高级应用1
- TextView高级应用之:TextView显示Html格式内容及图片
- HTML高级标签(3)————表单的应用
- HTML中条件注释的高级应用
- HTML高级标签之表单应用(二)
- Struts1.x系列教程(11):Validator验证框架高级应用
- 【原创】《Linux高级程序设计》杨宗德著 - TCP高级应用 - socket文件描述符属性控制
- Javascript 是你的高阶函数(高级应用)
- 傅老师课堂:Java高级应用之Struts2+Spring2+Hibernate3大集成
- Struts源码研究 - html-Cancel标签应用注意事项篇[转载]
- Android开发之TextView高级应用
- opencv轮廓高级应用(轮廓匹…