|
关键字 |
简介 |
示例代码 |
table-layout:automatic|fixed
|
表格布局
|
示例代码
|
border-collapse:separate|collapse
|
表格边框
|
示例代码
|
示例
1
:
表格布局
示例
2
:
表格边框
属性:table-layout
automatic; 单元格的大小由td的内容宽度决定
fixed; 单元格的大小由td上设置的宽度决定
注:只对连续的英文字母起作用,如果使用中文就看不到效果
");
window.frames["iframe_show472"].document.write(decodeHtml($("textarea#stepcodeTextarea472").val()));
window.frames["iframe_show472"].document.close();
$(window.frames["iframe_show472"]).load(function(){
$("#iframe_show472").height($("#iframe_show472").contents().find("body").height()+showittryitheight);
});
$("#iframe_show472").height($("#iframe_show472").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<style>
table.t1{
table-layout:automatic;
}
table.t2{
table-layout:fixed;
}
</style>
<table class="t1" border="1" width="100%">
<tr>
<td width="10%">abcdefghijklmnopqrstuvwxyz</td>
<td width="90%">abc</td>
</tr>
</table>
<table class="t2" border="1" width="100%">
<tr>
<td width="50px">abcdefghijklmnopqrstuvwxyz</td>
<td >abc</td>
</tr>
</table>
<style>
table.t1{
table-layout:automatic;
}
table.t2{
table-layout:fixed;
}
</style>
<table class="t1" border="1" width="100%">
<tr>
<td width="10%">abcdefghijklmnopqrstuvwxyz</td>
<td width="90%">abc</td>
</tr>
</table>
<table class="t2" border="1" width="100%">
<tr>
<td width="50px">abcdefghijklmnopqrstuvwxyz</td>
<td >abc</td>
</tr>
</table>
");
window.frames["iframe472"].document.write(decodeHtml(code472));
window.frames["iframe472"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe472"]).load(function(){
$("#iframe472").height($("#iframe472").contents().find("body").height()+showittryitheight);
});
$("#iframe472").height($("#iframe472").contents().find("body").height()+showittryitheight);
alreadyWriteCode472 = code472;
$("#rendering472").hide();
$("#rendered472").show();
}
var tRereshRetry2DemoPanel472 = setInterval(rereshRetry2DemoPanel472,1000);
var binded472 = false;
$("textarea#stepcodeTextarea472").keyup(function(){
if(!binded472){
$(window).bind('beforeunload',function(){
binded472 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code472 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code472!=newCode){
// window.frames["iframe472"].document.write("
");
// window.frames["iframe472"].document.write(decodeHtml($("textarea#stepcodeTextarea472").val()));
// window.frames["iframe472"].document.close();
// $(window.frames["iframe472"]).load(function(){
// $("#iframe472").height($("#iframe472").contents().find("body").height()+showittryitheight);
// });
// code472 = newCode;
// }
});
$(".tryButton472").click(function(){
$("#tryDiv472").show();
$("#stepcodeTextarea472").focus();
$("#stepcodeTextarea472").height(200);
$("#iframe472").height(0);
window.frames["iframe472"].document.write("
");
window.frames["iframe472"].document.write(decodeHtml($("textarea#stepcodeTextarea472").val()));
window.frames["iframe472"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe472"]).load(function(){
$("#iframe472").height($("#iframe472").contents().find("body").height()+showittryitheight);
});
$("#iframe472").height($("#iframe472").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor472.focus();
editor472.setSize(null, "250");
$("#rendering472").hide();
$("#rendered472").hide();
});
var mixedMode = {
name: "htmlmixed",
scriptTypes: [{matches: /\/x-handlebars-template|\/x-mustache/i,
mode: null},
{matches: /(text|application)\/(x-)?vb(a|script)/i,
mode: "vbscript"}]
};
var editor472 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea472"), {
lineNumbers: true,
styleActiveLine: true,
matchBrackets: true,
mode:"text/html",
theme:"eclipse",
selectionPointer: true,
lineWrapping: true,
extraKeys: {
"Alt-/": "autocomplete",
"Ctrl-F": "findPersistent",
"F8": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
}
}
});
editor472.on("change",function(doc){
if(!binded472){
$(window).bind('beforeunload',function(){
binded472 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code472 = newCode;
$("textarea#stepcodeTextarea472").val(newCode);
if(alreadyWriteCode472!=code472){
lastModifedTime472 = new Date().getTime();
$("#rendering472").show();
$("#rendered472").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor472 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor472.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv472").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
属性:border-collapse 值: separate:边框分隔 collapse:边框合并
");
window.frames["iframe_show473"].document.write(decodeHtml($("textarea#stepcodeTextarea473").val()));
window.frames["iframe_show473"].document.close();
$(window.frames["iframe_show473"]).load(function(){
$("#iframe_show473").height($("#iframe_show473").contents().find("body").height()+showittryitheight);
});
$("#iframe_show473").height($("#iframe_show473").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<style>
table.t1{
border-collapse:separate;
}
table.t2{
border-collapse:collapse;
}
</style>
<table class="t1" border="1" width="200px">
<tr>
<td width="50%">边框分离</td>
<td width="50%">边框分离</td>
</tr>
</table>
<br/>
<br/>
<table class="t2" border="1" width="200px">
<tr>
<td width="50%">边框合并</td>
<td width="50%">边框合并</td>
</tr>
</table>
<style>
table.t1{
border-collapse:separate;
}
table.t2{
border-collapse:collapse;
}
</style>
<table class="t1" border="1" width="200px">
<tr>
<td width="50%">边框分离</td>
<td width="50%">边框分离</td>
</tr>
</table>
<br/>
<br/>
<table class="t2" border="1" width="200px">
<tr>
<td width="50%">边框合并</td>
<td width="50%">边框合并</td>
</tr>
</table>
");
window.frames["iframe473"].document.write(decodeHtml(code473));
window.frames["iframe473"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe473"]).load(function(){
$("#iframe473").height($("#iframe473").contents().find("body").height()+showittryitheight);
});
$("#iframe473").height($("#iframe473").contents().find("body").height()+showittryitheight);
alreadyWriteCode473 = code473;
$("#rendering473").hide();
$("#rendered473").show();
}
var tRereshRetry2DemoPanel473 = setInterval(rereshRetry2DemoPanel473,1000);
var binded473 = false;
$("textarea#stepcodeTextarea473").keyup(function(){
if(!binded473){
$(window).bind('beforeunload',function(){
binded473 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code473 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code473!=newCode){
// window.frames["iframe473"].document.write("
");
// window.frames["iframe473"].document.write(decodeHtml($("textarea#stepcodeTextarea473").val()));
// window.frames["iframe473"].document.close();
// $(window.frames["iframe473"]).load(function(){
// $("#iframe473").height($("#iframe473").contents().find("body").height()+showittryitheight);
// });
// code473 = newCode;
// }
});
$(".tryButton473").click(function(){
$("#tryDiv473").show();
$("#stepcodeTextarea473").focus();
$("#stepcodeTextarea473").height(200);
$("#iframe473").height(0);
window.frames["iframe473"].document.write("
");
window.frames["iframe473"].document.write(decodeHtml($("textarea#stepcodeTextarea473").val()));
window.frames["iframe473"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe473"]).load(function(){
$("#iframe473").height($("#iframe473").contents().find("body").height()+showittryitheight);
});
$("#iframe473").height($("#iframe473").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor473.focus();
editor473.setSize(null, "250");
$("#rendering473").hide();
$("#rendered473").hide();
});
var mixedMode = {
name: "htmlmixed",
scriptTypes: [{matches: /\/x-handlebars-template|\/x-mustache/i,
mode: null},
{matches: /(text|application)\/(x-)?vb(a|script)/i,
mode: "vbscript"}]
};
var editor473 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea473"), {
lineNumbers: true,
styleActiveLine: true,
matchBrackets: true,
mode:"text/html",
theme:"eclipse",
selectionPointer: true,
lineWrapping: true,
extraKeys: {
"Alt-/": "autocomplete",
"Ctrl-F": "findPersistent",
"F8": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
}
}
});
editor473.on("change",function(doc){
if(!binded473){
$(window).bind('beforeunload',function(){
binded473 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code473 = newCode;
$("textarea#stepcodeTextarea473").val(newCode);
if(alreadyWriteCode473!=code473){
lastModifedTime473 = new Date().getTime();
$("#rendering473").show();
$("#rendered473").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor473 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor473.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv473").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|
代码高亮插件双击即可选中,不过部分同学反应,通过代码高亮插件复制的代码无法在IDEA里正常显示,这里提供TEXTAREA的方式,方便复制,谢谢
1. 自行完成练习
根据练习目标尽量自己实现代码效果,期间会碰到疑问,难题,和自己不懂的地方,这些都是必要的过程
2. 带着疑问查看答案
完成过程中,碰到无法解决的问题,带着疑问,查看答案,分析答案的解决思路
3. 查看答案讲解视频
依然有不明白的地方,点开视频讲解,带着疑问,听视频讲解有问题的部分
4. 再做一遍
理解后,再从头做一遍,把有疑问的地方都捋清楚
5. 总结
最后再总结一遍,总结思路,总结解决办法,以后遇到类似的问题,怎么处理
HOW2J公众号,关注后实时获知布最新的教程和优惠活动,谢谢。
提问之前请登陆
|