how2j.cn


工具版本兼容问题
<table>标签用于显示一个表格
<tr> 表示行
<td> 表示列又叫单元格

示例 1 : 3行2列表格   
示例 2 : 带边框的表格   
示例 3 : 设置table宽度   
示例 4 : 单元格宽度绝对值   
示例 5 : 单元格宽度相对值   
示例 6 : 单元格水平对齐   
示例 7 : 单元格垂直对齐   
示例 8 : 横跨两列, 水平合并   
示例 9 : 横跨两行, 垂直合并   
示例 10 : 背景色   

示例 1 :

3行2列表格

tr(table row)表示行,所有3个tr元素
td(table data)表示列,每一行,有2列,所以每一个tr元素里,有2个td元素
"); window.frames["iframe_show339"].document.write(decodeHtml($("textarea#stepcodeTextarea339").val())); window.frames["iframe_show339"].document.close(); $(window.frames["iframe_show339"]).load(function(){ $("#iframe_show339").height($("#iframe_show339").contents().find("body").height()+showittryitheight); }); $("#iframe_show339").height($("#iframe_show339").contents().find("body").height()+showittryitheight); setTimeout(function(){ },500); });
运行效果
<table> <tr> <td>1</td> <td>2</td> </tr> <tr> <td>3</td> <td>4</td> </tr> <tr> <td>a</td> <td>b</td> </tr> </table>
<table>
  <tr>
      <td>1</td>
      <td>2</td>
  </tr>

  <tr>
      <td>3</td>
      <td>4</td>
  </tr>

  <tr>
      <td>a</td>
      <td>b</td>
  </tr>

</table>
"); window.frames["iframe339"].document.write(decodeHtml(code339)); window.frames["iframe339"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe339"]).load(function(){ $("#iframe339").height($("#iframe339").contents().find("body").height()+showittryitheight); }); $("#iframe339").height($("#iframe339").contents().find("body").height()+showittryitheight); alreadyWriteCode339 = code339; $("#rendering339").hide(); $("#rendered339").show(); } var tRereshRetry2DemoPanel339 = setInterval(rereshRetry2DemoPanel339,1000); var binded339 = false; $("textarea#stepcodeTextarea339").keyup(function(){ if(!binded339){ $(window).bind('beforeunload',function(){ binded339 = true; return "xxxx"; }); } var newCode = $(this).val() code339 = newCode; /*below code is replaced by function rereshRetry2DemoPanel()*/ // if(code339!=newCode){ // window.frames["iframe339"].document.write("
"); // window.frames["iframe339"].document.write(decodeHtml($("textarea#stepcodeTextarea339").val())); // window.frames["iframe339"].document.close(); // $(window.frames["iframe339"]).load(function(){ // $("#iframe339").height($("#iframe339").contents().find("body").height()+showittryitheight); // }); // code339 = newCode; // } }); $(".tryButton339").click(function(){ $("#tryDiv339").show(); $("#stepcodeTextarea339").focus(); $("#stepcodeTextarea339").height(200); $("#iframe339").height(0); window.frames["iframe339"].document.write("
"); window.frames["iframe339"].document.write(decodeHtml($("textarea#stepcodeTextarea339").val())); window.frames["iframe339"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe339"]).load(function(){ $("#iframe339").height($("#iframe339").contents().find("body").height()+showittryitheight); }); $("#iframe339").height($("#iframe339").contents().find("body").height()+showittryitheight); this.scrollIntoView(true); editor339.focus(); editor339.setSize(null, "250"); $("#rendering339").hide(); $("#rendered339").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 editor339 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea339"), { 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); } } }); editor339.on("change",function(doc){ if(!binded339){ $(window).bind('beforeunload',function(){ binded339 = true; return "xxxx"; }); } var newCode = doc.getValue(); code339 = newCode; $("textarea#stepcodeTextarea339").val(newCode); if(alreadyWriteCode339!=code339){ lastModifedTime339 = new Date().getTime(); $("#rendering339").show(); $("#rendered339").hide(); } // alert(doc.getValue()); }); $(".CodeMirror").addClass("form-control"); // var editor339 = CodeMirror.fromTextArea(, { // lineNumbers: true, // styleActiveLine: true, // matchBrackets: true, // theme:"eclipse", // }); editor339.on("change",function(doc){ // alert(doc.getValue()); }); $("#tryDiv339").hide(); }); $("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");


源代码
1. 双击选中单词 2. 三击选中整行 3. CTRL+F 查找 4. F8 全屏编辑,再次点击恢复
渲染中 渲染完成
效果
示例 2 :

带边框的表格

设置table的属性border
"); window.frames["iframe_show340"].document.write(decodeHtml($("textarea#stepcodeTextarea340").val())); window.frames["iframe_show340"].document.close(); $(window.frames["iframe_show340"]).load(function(){ $("#iframe_show340").height($("#iframe_show340").contents().find("body").height()+showittryitheight); }); $("#iframe_show340").height($("#iframe_show340").contents().find("body").height()+showittryitheight); setTimeout(function(){ },500); });
运行效果
<table border="1"> <tr> <td>1</td> <td>2</td> </tr> <tr> <td>3</td> <td>4</td> </tr> <tr> <td>a</td> <td>b</td> </tr> </table>
<table border="1">
  <tr>
      <td>1</td>
      <td>2</td>
  </tr>

  <tr>
      <td>3</td>
      <td>4</td>
  </tr>

  <tr>
      <td>a</td>
      <td>b</td>
  </tr>

</table>
"); window.frames["iframe340"].document.write(decodeHtml(code340)); window.frames["iframe340"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe340"]).load(function(){ $("#iframe340").height($("#iframe340").contents().find("body").height()+showittryitheight); }); $("#iframe340").height($("#iframe340").contents().find("body").height()+showittryitheight); alreadyWriteCode340 = code340; $("#rendering340").hide(); $("#rendered340").show(); } var tRereshRetry2DemoPanel340 = setInterval(rereshRetry2DemoPanel340,1000); var binded340 = false; $("textarea#stepcodeTextarea340").keyup(function(){ if(!binded340){ $(window).bind('beforeunload',function(){ binded340 = true; return "xxxx"; }); } var newCode = $(this).val() code340 = newCode; /*below code is replaced by function rereshRetry2DemoPanel()*/ // if(code340!=newCode){ // window.frames["iframe340"].document.write("
"); // window.frames["iframe340"].document.write(decodeHtml($("textarea#stepcodeTextarea340").val())); // window.frames["iframe340"].document.close(); // $(window.frames["iframe340"]).load(function(){ // $("#iframe340").height($("#iframe340").contents().find("body").height()+showittryitheight); // }); // code340 = newCode; // } }); $(".tryButton340").click(function(){ $("#tryDiv340").show(); $("#stepcodeTextarea340").focus(); $("#stepcodeTextarea340").height(200); $("#iframe340").height(0); window.frames["iframe340"].document.write("
"); window.frames["iframe340"].document.write(decodeHtml($("textarea#stepcodeTextarea340").val())); window.frames["iframe340"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe340"]).load(function(){ $("#iframe340").height($("#iframe340").contents().find("body").height()+showittryitheight); }); $("#iframe340").height($("#iframe340").contents().find("body").height()+showittryitheight); this.scrollIntoView(true); editor340.focus(); editor340.setSize(null, "250"); $("#rendering340").hide(); $("#rendered340").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 editor340 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea340"), { 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); } } }); editor340.on("change",function(doc){ if(!binded340){ $(window).bind('beforeunload',function(){ binded340 = true; return "xxxx"; }); } var newCode = doc.getValue(); code340 = newCode; $("textarea#stepcodeTextarea340").val(newCode); if(alreadyWriteCode340!=code340){ lastModifedTime340 = new Date().getTime(); $("#rendering340").show(); $("#rendered340").hide(); } // alert(doc.getValue()); }); $(".CodeMirror").addClass("form-control"); // var editor340 = CodeMirror.fromTextArea(, { // lineNumbers: true, // styleActiveLine: true, // matchBrackets: true, // theme:"eclipse", // }); editor340.on("change",function(doc){ // alert(doc.getValue()); }); $("#tryDiv340").hide(); }); $("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");


源代码
1. 双击选中单词 2. 三击选中整行 3. CTRL+F 查找 4. F8 全屏编辑,再次点击恢复
渲染中 渲染完成
效果
示例 3 :

设置table宽度

设置table的属性 width
px即像素的意思。
比如你的分辨率是1024X768,则你的屏幕横向就有1024个像素
"); window.frames["iframe_show341"].document.write(decodeHtml($("textarea#stepcodeTextarea341").val())); window.frames["iframe_show341"].document.close(); $(window.frames["iframe_show341"]).load(function(){ $("#iframe_show341").height($("#iframe_show341").contents().find("body").height()+showittryitheight); }); $("#iframe_show341").height($("#iframe_show341").contents().find("body").height()+showittryitheight); setTimeout(function(){ },500); });
运行效果
<table border="1" width="200px"> <tr> <td>1</td> <td>2</td> </tr> <tr> <td>3</td> <td>4</td> </tr> <tr> <td>a</td> <td>b</td> </tr> </table>
<table border="1" width="200px">
  <tr>
      <td>1</td>
      <td>2</td>
  </tr>

  <tr>
      <td>3</td>
      <td>4</td>
  </tr>

  <tr>
      <td>a</td>
      <td>b</td>
  </tr>

</table>
"); window.frames["iframe341"].document.write(decodeHtml(code341)); window.frames["iframe341"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe341"]).load(function(){ $("#iframe341").height($("#iframe341").contents().find("body").height()+showittryitheight); }); $("#iframe341").height($("#iframe341").contents().find("body").height()+showittryitheight); alreadyWriteCode341 = code341; $("#rendering341").hide(); $("#rendered341").show(); } var tRereshRetry2DemoPanel341 = setInterval(rereshRetry2DemoPanel341,1000); var binded341 = false; $("textarea#stepcodeTextarea341").keyup(function(){ if(!binded341){ $(window).bind('beforeunload',function(){ binded341 = true; return "xxxx"; }); } var newCode = $(this).val() code341 = newCode; /*below code is replaced by function rereshRetry2DemoPanel()*/ // if(code341!=newCode){ // window.frames["iframe341"].document.write("
"); // window.frames["iframe341"].document.write(decodeHtml($("textarea#stepcodeTextarea341").val())); // window.frames["iframe341"].document.close(); // $(window.frames["iframe341"]).load(function(){ // $("#iframe341").height($("#iframe341").contents().find("body").height()+showittryitheight); // }); // code341 = newCode; // } }); $(".tryButton341").click(function(){ $("#tryDiv341").show(); $("#stepcodeTextarea341").focus(); $("#stepcodeTextarea341").height(200); $("#iframe341").height(0); window.frames["iframe341"].document.write("
"); window.frames["iframe341"].document.write(decodeHtml($("textarea#stepcodeTextarea341").val())); window.frames["iframe341"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe341"]).load(function(){ $("#iframe341").height($("#iframe341").contents().find("body").height()+showittryitheight); }); $("#iframe341").height($("#iframe341").contents().find("body").height()+showittryitheight); this.scrollIntoView(true); editor341.focus(); editor341.setSize(null, "250"); $("#rendering341").hide(); $("#rendered341").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 editor341 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea341"), { 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); } } }); editor341.on("change",function(doc){ if(!binded341){ $(window).bind('beforeunload',function(){ binded341 = true; return "xxxx"; }); } var newCode = doc.getValue(); code341 = newCode; $("textarea#stepcodeTextarea341").val(newCode); if(alreadyWriteCode341!=code341){ lastModifedTime341 = new Date().getTime(); $("#rendering341").show(); $("#rendered341").hide(); } // alert(doc.getValue()); }); $(".CodeMirror").addClass("form-control"); // var editor341 = CodeMirror.fromTextArea(, { // lineNumbers: true, // styleActiveLine: true, // matchBrackets: true, // theme:"eclipse", // }); editor341.on("change",function(doc){ // alert(doc.getValue()); }); $("#tryDiv341").hide(); }); $("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");


源代码
1. 双击选中单词 2. 三击选中整行 3. CTRL+F 查找 4. F8 全屏编辑,再次点击恢复
渲染中 渲染完成
效果
示例 4 :

单元格宽度绝对值

设置td的属性width
在示例里,1单元格设置了宽度,那么3,和a单元格,自动继承该宽度
2单元格的宽度由table宽度和1单元格的宽度决定
"); window.frames["iframe_show342"].document.write(decodeHtml($("textarea#stepcodeTextarea342").val())); window.frames["iframe_show342"].document.close(); $(window.frames["iframe_show342"]).load(function(){ $("#iframe_show342").height($("#iframe_show342").contents().find("body").height()+showittryitheight); }); $("#iframe_show342").height($("#iframe_show342").contents().find("body").height()+showittryitheight); setTimeout(function(){ },500); });
运行效果
<table border="1" width="200px"> <tr> <td width="50px">1</td> <td>2</td> </tr> <tr> <td>3</td> <td>4</td> </tr> <tr> <td>a</td> <td>b</td> </tr> </table>
<table border="1" width="200px">
  <tr>
      <td width="50px">1</td>
      <td>2</td>
  </tr>

  <tr>
      <td>3</td>
      <td>4</td>
  </tr>

  <tr>
      <td>a</td>
      <td>b</td>
  </tr>

</table>
"); window.frames["iframe342"].document.write(decodeHtml(code342)); window.frames["iframe342"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe342"]).load(function(){ $("#iframe342").height($("#iframe342").contents().find("body").height()+showittryitheight); }); $("#iframe342").height($("#iframe342").contents().find("body").height()+showittryitheight); alreadyWriteCode342 = code342; $("#rendering342").hide(); $("#rendered342").show(); } var tRereshRetry2DemoPanel342 = setInterval(rereshRetry2DemoPanel342,1000); var binded342 = false; $("textarea#stepcodeTextarea342").keyup(function(){ if(!binded342){ $(window).bind('beforeunload',function(){ binded342 = true; return "xxxx"; }); } var newCode = $(this).val() code342 = newCode; /*below code is replaced by function rereshRetry2DemoPanel()*/ // if(code342!=newCode){ // window.frames["iframe342"].document.write("
"); // window.frames["iframe342"].document.write(decodeHtml($("textarea#stepcodeTextarea342").val())); // window.frames["iframe342"].document.close(); // $(window.frames["iframe342"]).load(function(){ // $("#iframe342").height($("#iframe342").contents().find("body").height()+showittryitheight); // }); // code342 = newCode; // } }); $(".tryButton342").click(function(){ $("#tryDiv342").show(); $("#stepcodeTextarea342").focus(); $("#stepcodeTextarea342").height(200); $("#iframe342").height(0); window.frames["iframe342"].document.write("
"); window.frames["iframe342"].document.write(decodeHtml($("textarea#stepcodeTextarea342").val())); window.frames["iframe342"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe342"]).load(function(){ $("#iframe342").height($("#iframe342").contents().find("body").height()+showittryitheight); }); $("#iframe342").height($("#iframe342").contents().find("body").height()+showittryitheight); this.scrollIntoView(true); editor342.focus(); editor342.setSize(null, "250"); $("#rendering342").hide(); $("#rendered342").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 editor342 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea342"), { 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); } } }); editor342.on("change",function(doc){ if(!binded342){ $(window).bind('beforeunload',function(){ binded342 = true; return "xxxx"; }); } var newCode = doc.getValue(); code342 = newCode; $("textarea#stepcodeTextarea342").val(newCode); if(alreadyWriteCode342!=code342){ lastModifedTime342 = new Date().getTime(); $("#rendering342").show(); $("#rendered342").hide(); } // alert(doc.getValue()); }); $(".CodeMirror").addClass("form-control"); // var editor342 = CodeMirror.fromTextArea(, { // lineNumbers: true, // styleActiveLine: true, // matchBrackets: true, // theme:"eclipse", // }); editor342.on("change",function(doc){ // alert(doc.getValue()); }); $("#tryDiv342").hide(); }); $("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");


源代码
1. 双击选中单词 2. 三击选中整行 3. CTRL+F 查找 4. F8 全屏编辑,再次点击恢复
渲染中 渲染完成
效果
示例 5 :

单元格宽度相对值

设置td的属性width为百分数
"); window.frames["iframe_show343"].document.write(decodeHtml($("textarea#stepcodeTextarea343").val())); window.frames["iframe_show343"].document.close(); $(window.frames["iframe_show343"]).load(function(){ $("#iframe_show343").height($("#iframe_show343").contents().find("body").height()+showittryitheight); }); $("#iframe_show343").height($("#iframe_show343").contents().find("body").height()+showittryitheight); setTimeout(function(){ },500); });
运行效果
<table border="1" width="200px"> <tr> <td width="80%">1</td> <td>2</td> </tr> <tr> <td>3</td> <td>4</td> </tr> <tr> <td>a</td> <td>b</td> </tr> </table>
<table border="1" width="200px">
  <tr>
      <td width="80%">1</td>
      <td>2</td>
  </tr>

  <tr>
      <td>3</td>
      <td>4</td>
  </tr>

  <tr>
      <td>a</td>
      <td>b</td>
  </tr>

</table>
"); window.frames["iframe343"].document.write(decodeHtml(code343)); window.frames["iframe343"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe343"]).load(function(){ $("#iframe343").height($("#iframe343").contents().find("body").height()+showittryitheight); }); $("#iframe343").height($("#iframe343").contents().find("body").height()+showittryitheight); alreadyWriteCode343 = code343; $("#rendering343").hide(); $("#rendered343").show(); } var tRereshRetry2DemoPanel343 = setInterval(rereshRetry2DemoPanel343,1000); var binded343 = false; $("textarea#stepcodeTextarea343").keyup(function(){ if(!binded343){ $(window).bind('beforeunload',function(){ binded343 = true; return "xxxx"; }); } var newCode = $(this).val() code343 = newCode; /*below code is replaced by function rereshRetry2DemoPanel()*/ // if(code343!=newCode){ // window.frames["iframe343"].document.write("
"); // window.frames["iframe343"].document.write(decodeHtml($("textarea#stepcodeTextarea343").val())); // window.frames["iframe343"].document.close(); // $(window.frames["iframe343"]).load(function(){ // $("#iframe343").height($("#iframe343").contents().find("body").height()+showittryitheight); // }); // code343 = newCode; // } }); $(".tryButton343").click(function(){ $("#tryDiv343").show(); $("#stepcodeTextarea343").focus(); $("#stepcodeTextarea343").height(200); $("#iframe343").height(0); window.frames["iframe343"].document.write("
"); window.frames["iframe343"].document.write(decodeHtml($("textarea#stepcodeTextarea343").val())); window.frames["iframe343"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe343"]).load(function(){ $("#iframe343").height($("#iframe343").contents().find("body").height()+showittryitheight); }); $("#iframe343").height($("#iframe343").contents().find("body").height()+showittryitheight); this.scrollIntoView(true); editor343.focus(); editor343.setSize(null, "250"); $("#rendering343").hide(); $("#rendered343").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 editor343 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea343"), { 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); } } }); editor343.on("change",function(doc){ if(!binded343){ $(window).bind('beforeunload',function(){ binded343 = true; return "xxxx"; }); } var newCode = doc.getValue(); code343 = newCode; $("textarea#stepcodeTextarea343").val(newCode); if(alreadyWriteCode343!=code343){ lastModifedTime343 = new Date().getTime(); $("#rendering343").show(); $("#rendered343").hide(); } // alert(doc.getValue()); }); $(".CodeMirror").addClass("form-control"); // var editor343 = CodeMirror.fromTextArea(, { // lineNumbers: true, // styleActiveLine: true, // matchBrackets: true, // theme:"eclipse", // }); editor343.on("change",function(doc){ // alert(doc.getValue()); }); $("#tryDiv343").hide(); }); $("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");


源代码
1. 双击选中单词 2. 三击选中整行 3. CTRL+F 查找 4. F8 全屏编辑,再次点击恢复
渲染中 渲染完成
效果
示例 6 :

单元格水平对齐

设置td的属性align
"); window.frames["iframe_show344"].document.write(decodeHtml($("textarea#stepcodeTextarea344").val())); window.frames["iframe_show344"].document.close(); $(window.frames["iframe_show344"]).load(function(){ $("#iframe_show344").height($("#iframe_show344").contents().find("body").height()+showittryitheight); }); $("#iframe_show344").height($("#iframe_show344").contents().find("body").height()+showittryitheight); setTimeout(function(){ },500); });
运行效果
<table border="1" width="200px"> <tr> <td width="50%" align="left">1</td> <td>2</td> </tr> <tr> <td align="center">3</td> <td>4</td> </tr> <tr> <td align="right">a</td> <td>b</td> </tr> </table>
<table border="1" width="200px">
  <tr>
      <td width="50%" align="left">1</td>
      <td>2</td>
  </tr>

  <tr>
      <td align="center">3</td>
      <td>4</td>
  </tr>

  <tr>
      <td align="right">a</td>
      <td>b</td>
  </tr>

</table>
"); window.frames["iframe344"].document.write(decodeHtml(code344)); window.frames["iframe344"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe344"]).load(function(){ $("#iframe344").height($("#iframe344").contents().find("body").height()+showittryitheight); }); $("#iframe344").height($("#iframe344").contents().find("body").height()+showittryitheight); alreadyWriteCode344 = code344; $("#rendering344").hide(); $("#rendered344").show(); } var tRereshRetry2DemoPanel344 = setInterval(rereshRetry2DemoPanel344,1000); var binded344 = false; $("textarea#stepcodeTextarea344").keyup(function(){ if(!binded344){ $(window).bind('beforeunload',function(){ binded344 = true; return "xxxx"; }); } var newCode = $(this).val() code344 = newCode; /*below code is replaced by function rereshRetry2DemoPanel()*/ // if(code344!=newCode){ // window.frames["iframe344"].document.write("
"); // window.frames["iframe344"].document.write(decodeHtml($("textarea#stepcodeTextarea344").val())); // window.frames["iframe344"].document.close(); // $(window.frames["iframe344"]).load(function(){ // $("#iframe344").height($("#iframe344").contents().find("body").height()+showittryitheight); // }); // code344 = newCode; // } }); $(".tryButton344").click(function(){ $("#tryDiv344").show(); $("#stepcodeTextarea344").focus(); $("#stepcodeTextarea344").height(200); $("#iframe344").height(0); window.frames["iframe344"].document.write("
"); window.frames["iframe344"].document.write(decodeHtml($("textarea#stepcodeTextarea344").val())); window.frames["iframe344"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe344"]).load(function(){ $("#iframe344").height($("#iframe344").contents().find("body").height()+showittryitheight); }); $("#iframe344").height($("#iframe344").contents().find("body").height()+showittryitheight); this.scrollIntoView(true); editor344.focus(); editor344.setSize(null, "250"); $("#rendering344").hide(); $("#rendered344").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 editor344 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea344"), { 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); } } }); editor344.on("change",function(doc){ if(!binded344){ $(window).bind('beforeunload',function(){ binded344 = true; return "xxxx"; }); } var newCode = doc.getValue(); code344 = newCode; $("textarea#stepcodeTextarea344").val(newCode); if(alreadyWriteCode344!=code344){ lastModifedTime344 = new Date().getTime(); $("#rendering344").show(); $("#rendered344").hide(); } // alert(doc.getValue()); }); $(".CodeMirror").addClass("form-control"); // var editor344 = CodeMirror.fromTextArea(, { // lineNumbers: true, // styleActiveLine: true, // matchBrackets: true, // theme:"eclipse", // }); editor344.on("change",function(doc){ // alert(doc.getValue()); }); $("#tryDiv344").hide(); }); $("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");


源代码
1. 双击选中单词 2. 三击选中整行 3. CTRL+F 查找 4. F8 全屏编辑,再次点击恢复
渲染中 渲染完成
效果
示例 7 :

单元格垂直对齐

设置td的属性valign
"); window.frames["iframe_show345"].document.write(decodeHtml($("textarea#stepcodeTextarea345").val())); window.frames["iframe_show345"].document.close(); $(window.frames["iframe_show345"]).load(function(){ $("#iframe_show345").height($("#iframe_show345").contents().find("body").height()+showittryitheight); }); $("#iframe_show345").height($("#iframe_show345").contents().find("body").height()+showittryitheight); setTimeout(function(){ },500); });
运行效果
<table border="1" width="200px"> <tr> <td width="50%" valign="top" >1</td> <td> 2 <br/> 2 <br/> 2 <br/> </td> </tr> <tr> <td valign="middle" >3</td> <td> 4 <br/> 4 <br/> 4 <br/> </td> </tr> <tr> <td valign="bottom" >a</td> <td> b <br/> b <br/> b <br/> </td> </tr> </table>
"); window.frames["iframe345"].document.write(decodeHtml(code345)); window.frames["iframe345"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe345"]).load(function(){ $("#iframe345").height($("#iframe345").contents().find("body").height()+showittryitheight); }); $("#iframe345").height($("#iframe345").contents().find("body").height()+showittryitheight); alreadyWriteCode345 = code345; $("#rendering345").hide(); $("#rendered345").show(); } var tRereshRetry2DemoPanel345 = setInterval(rereshRetry2DemoPanel345,1000); var binded345 = false; $("textarea#stepcodeTextarea345").keyup(function(){ if(!binded345){ $(window).bind('beforeunload',function(){ binded345 = true; return "xxxx"; }); } var newCode = $(this).val() code345 = newCode; /*below code is replaced by function rereshRetry2DemoPanel()*/ // if(code345!=newCode){ // window.frames["iframe345"].document.write("
"); // window.frames["iframe345"].document.write(decodeHtml($("textarea#stepcodeTextarea345").val())); // window.frames["iframe345"].document.close(); // $(window.frames["iframe345"]).load(function(){ // $("#iframe345").height($("#iframe345").contents().find("body").height()+showittryitheight); // }); // code345 = newCode; // } }); $(".tryButton345").click(function(){ $("#tryDiv345").show(); $("#stepcodeTextarea345").focus(); $("#stepcodeTextarea345").height(200); $("#iframe345").height(0); window.frames["iframe345"].document.write("
"); window.frames["iframe345"].document.write(decodeHtml($("textarea#stepcodeTextarea345").val())); window.frames["iframe345"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe345"]).load(function(){ $("#iframe345").height($("#iframe345").contents().find("body").height()+showittryitheight); }); $("#iframe345").height($("#iframe345").contents().find("body").height()+showittryitheight); this.scrollIntoView(true); editor345.focus(); editor345.setSize(null, "250"); $("#rendering345").hide(); $("#rendered345").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 editor345 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea345"), { 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); } } }); editor345.on("change",function(doc){ if(!binded345){ $(window).bind('beforeunload',function(){ binded345 = true; return "xxxx"; }); } var newCode = doc.getValue(); code345 = newCode; $("textarea#stepcodeTextarea345").val(newCode); if(alreadyWriteCode345!=code345){ lastModifedTime345 = new Date().getTime(); $("#rendering345").show(); $("#rendered345").hide(); } // alert(doc.getValue()); }); $(".CodeMirror").addClass("form-control"); // var editor345 = CodeMirror.fromTextArea(, { // lineNumbers: true, // styleActiveLine: true, // matchBrackets: true, // theme:"eclipse", // }); editor345.on("change",function(doc){ // alert(doc.getValue()); }); $("#tryDiv345").hide(); }); $("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");


源代码
1. 双击选中单词 2. 三击选中整行 3. CTRL+F 查找 4. F8 全屏编辑,再次点击恢复
渲染中 渲染完成
效果
示例 8 :

横跨两列, 水平合并

设置td的属性colspan
"); window.frames["iframe_show346"].document.write(decodeHtml($("textarea#stepcodeTextarea346").val())); window.frames["iframe_show346"].document.close(); $(window.frames["iframe_show346"]).load(function(){ $("#iframe_show346").height($("#iframe_show346").contents().find("body").height()+showittryitheight); }); $("#iframe_show346").height($("#iframe_show346").contents().find("body").height()+showittryitheight); setTimeout(function(){ },500); });
运行效果
<table border="1" width="200px"> <tr> <td colspan="2" >1,2</td> </tr> <tr> <td>3</td> <td>4</td> </tr> <tr> <td>a</td> <td>b</td> </tr> </table>
<table border="1" width="200px">
  <tr>
      <td colspan="2" >1,2</td>
  </tr>

  <tr>
      <td>3</td>
      <td>4</td>
  </tr>

  <tr>
      <td>a</td>
      <td>b</td>
  </tr>

</table>
"); window.frames["iframe346"].document.write(decodeHtml(code346)); window.frames["iframe346"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe346"]).load(function(){ $("#iframe346").height($("#iframe346").contents().find("body").height()+showittryitheight); }); $("#iframe346").height($("#iframe346").contents().find("body").height()+showittryitheight); alreadyWriteCode346 = code346; $("#rendering346").hide(); $("#rendered346").show(); } var tRereshRetry2DemoPanel346 = setInterval(rereshRetry2DemoPanel346,1000); var binded346 = false; $("textarea#stepcodeTextarea346").keyup(function(){ if(!binded346){ $(window).bind('beforeunload',function(){ binded346 = true; return "xxxx"; }); } var newCode = $(this).val() code346 = newCode; /*below code is replaced by function rereshRetry2DemoPanel()*/ // if(code346!=newCode){ // window.frames["iframe346"].document.write("
"); // window.frames["iframe346"].document.write(decodeHtml($("textarea#stepcodeTextarea346").val())); // window.frames["iframe346"].document.close(); // $(window.frames["iframe346"]).load(function(){ // $("#iframe346").height($("#iframe346").contents().find("body").height()+showittryitheight); // }); // code346 = newCode; // } }); $(".tryButton346").click(function(){ $("#tryDiv346").show(); $("#stepcodeTextarea346").focus(); $("#stepcodeTextarea346").height(200); $("#iframe346").height(0); window.frames["iframe346"].document.write("
"); window.frames["iframe346"].document.write(decodeHtml($("textarea#stepcodeTextarea346").val())); window.frames["iframe346"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe346"]).load(function(){ $("#iframe346").height($("#iframe346").contents().find("body").height()+showittryitheight); }); $("#iframe346").height($("#iframe346").contents().find("body").height()+showittryitheight); this.scrollIntoView(true); editor346.focus(); editor346.setSize(null, "250"); $("#rendering346").hide(); $("#rendered346").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 editor346 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea346"), { 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); } } }); editor346.on("change",function(doc){ if(!binded346){ $(window).bind('beforeunload',function(){ binded346 = true; return "xxxx"; }); } var newCode = doc.getValue(); code346 = newCode; $("textarea#stepcodeTextarea346").val(newCode); if(alreadyWriteCode346!=code346){ lastModifedTime346 = new Date().getTime(); $("#rendering346").show(); $("#rendered346").hide(); } // alert(doc.getValue()); }); $(".CodeMirror").addClass("form-control"); // var editor346 = CodeMirror.fromTextArea(, { // lineNumbers: true, // styleActiveLine: true, // matchBrackets: true, // theme:"eclipse", // }); editor346.on("change",function(doc){ // alert(doc.getValue()); }); $("#tryDiv346").hide(); }); $("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");


源代码
1. 双击选中单词 2. 三击选中整行 3. CTRL+F 查找 4. F8 全屏编辑,再次点击恢复
渲染中 渲染完成
效果
示例 9 :

横跨两行, 垂直合并

设置td的属性rowspan
"); window.frames["iframe_show347"].document.write(decodeHtml($("textarea#stepcodeTextarea347").val())); window.frames["iframe_show347"].document.close(); $(window.frames["iframe_show347"]).load(function(){ $("#iframe_show347").height($("#iframe_show347").contents().find("body").height()+showittryitheight); }); $("#iframe_show347").height($("#iframe_show347").contents().find("body").height()+showittryitheight); setTimeout(function(){ },500); });
运行效果
<table border="1" width="200px"> <tr> <td rowspan="2">1,3</td> <td>2</td> </tr> <tr> <td>4</td> </tr> <tr> <td>a</td> <td>b</td> </tr> </table>
<table border="1" width="200px">
  <tr>
      <td rowspan="2">1,3</td>
      <td>2</td>
  </tr>

  <tr>
      <td>4</td>
  </tr>

  <tr>
      <td>a</td>
      <td>b</td>
  </tr>

</table>
"); window.frames["iframe347"].document.write(decodeHtml(code347)); window.frames["iframe347"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe347"]).load(function(){ $("#iframe347").height($("#iframe347").contents().find("body").height()+showittryitheight); }); $("#iframe347").height($("#iframe347").contents().find("body").height()+showittryitheight); alreadyWriteCode347 = code347; $("#rendering347").hide(); $("#rendered347").show(); } var tRereshRetry2DemoPanel347 = setInterval(rereshRetry2DemoPanel347,1000); var binded347 = false; $("textarea#stepcodeTextarea347").keyup(function(){ if(!binded347){ $(window).bind('beforeunload',function(){ binded347 = true; return "xxxx"; }); } var newCode = $(this).val() code347 = newCode; /*below code is replaced by function rereshRetry2DemoPanel()*/ // if(code347!=newCode){ // window.frames["iframe347"].document.write("
"); // window.frames["iframe347"].document.write(decodeHtml($("textarea#stepcodeTextarea347").val())); // window.frames["iframe347"].document.close(); // $(window.frames["iframe347"]).load(function(){ // $("#iframe347").height($("#iframe347").contents().find("body").height()+showittryitheight); // }); // code347 = newCode; // } }); $(".tryButton347").click(function(){ $("#tryDiv347").show(); $("#stepcodeTextarea347").focus(); $("#stepcodeTextarea347").height(200); $("#iframe347").height(0); window.frames["iframe347"].document.write("
"); window.frames["iframe347"].document.write(decodeHtml($("textarea#stepcodeTextarea347").val())); window.frames["iframe347"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe347"]).load(function(){ $("#iframe347").height($("#iframe347").contents().find("body").height()+showittryitheight); }); $("#iframe347").height($("#iframe347").contents().find("body").height()+showittryitheight); this.scrollIntoView(true); editor347.focus(); editor347.setSize(null, "250"); $("#rendering347").hide(); $("#rendered347").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 editor347 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea347"), { 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); } } }); editor347.on("change",function(doc){ if(!binded347){ $(window).bind('beforeunload',function(){ binded347 = true; return "xxxx"; }); } var newCode = doc.getValue(); code347 = newCode; $("textarea#stepcodeTextarea347").val(newCode); if(alreadyWriteCode347!=code347){ lastModifedTime347 = new Date().getTime(); $("#rendering347").show(); $("#rendered347").hide(); } // alert(doc.getValue()); }); $(".CodeMirror").addClass("form-control"); // var editor347 = CodeMirror.fromTextArea(, { // lineNumbers: true, // styleActiveLine: true, // matchBrackets: true, // theme:"eclipse", // }); editor347.on("change",function(doc){ // alert(doc.getValue()); }); $("#tryDiv347").hide(); }); $("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");


源代码
1. 双击选中单词 2. 三击选中整行 3. CTRL+F 查找 4. F8 全屏编辑,再次点击恢复
渲染中 渲染完成
效果
示例 10 :

背景色

设置tr或者td的属性bgcolor
"); window.frames["iframe_show348"].document.write(decodeHtml($("textarea#stepcodeTextarea348").val())); window.frames["iframe_show348"].document.close(); $(window.frames["iframe_show348"]).load(function(){ $("#iframe_show348").height($("#iframe_show348").contents().find("body").height()+showittryitheight); }); $("#iframe_show348").height($("#iframe_show348").contents().find("body").height()+showittryitheight); setTimeout(function(){ },500); });
运行效果
<table border="1" width="200px"> <tr bgcolor="gray"> <td width="50%">1</td> <td>2</td> </tr> <tr> <td>3</td> <td>4</td> </tr> <tr> <td>a</td> <td bgcolor="pink">b</td> </tr> </table>
<table border="1" width="200px">
  <tr bgcolor="gray">
      <td width="50%">1</td>
      <td>2</td>
  </tr>

  <tr>
      <td>3</td>
      <td>4</td>
  </tr>

  <tr>
      <td>a</td>
      <td  bgcolor="pink">b</td>
  </tr>

</table>
"); window.frames["iframe348"].document.write(decodeHtml(code348)); window.frames["iframe348"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe348"]).load(function(){ $("#iframe348").height($("#iframe348").contents().find("body").height()+showittryitheight); }); $("#iframe348").height($("#iframe348").contents().find("body").height()+showittryitheight); alreadyWriteCode348 = code348; $("#rendering348").hide(); $("#rendered348").show(); } var tRereshRetry2DemoPanel348 = setInterval(rereshRetry2DemoPanel348,1000); var binded348 = false; $("textarea#stepcodeTextarea348").keyup(function(){ if(!binded348){ $(window).bind('beforeunload',function(){ binded348 = true; return "xxxx"; }); } var newCode = $(this).val() code348 = newCode; /*below code is replaced by function rereshRetry2DemoPanel()*/ // if(code348!=newCode){ // window.frames["iframe348"].document.write("
"); // window.frames["iframe348"].document.write(decodeHtml($("textarea#stepcodeTextarea348").val())); // window.frames["iframe348"].document.close(); // $(window.frames["iframe348"]).load(function(){ // $("#iframe348").height($("#iframe348").contents().find("body").height()+showittryitheight); // }); // code348 = newCode; // } }); $(".tryButton348").click(function(){ $("#tryDiv348").show(); $("#stepcodeTextarea348").focus(); $("#stepcodeTextarea348").height(200); $("#iframe348").height(0); window.frames["iframe348"].document.write("
"); window.frames["iframe348"].document.write(decodeHtml($("textarea#stepcodeTextarea348").val())); window.frames["iframe348"].document.close(); //load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式 $(window.frames["iframe348"]).load(function(){ $("#iframe348").height($("#iframe348").contents().find("body").height()+showittryitheight); }); $("#iframe348").height($("#iframe348").contents().find("body").height()+showittryitheight); this.scrollIntoView(true); editor348.focus(); editor348.setSize(null, "250"); $("#rendering348").hide(); $("#rendered348").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 editor348 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea348"), { 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); } } }); editor348.on("change",function(doc){ if(!binded348){ $(window).bind('beforeunload',function(){ binded348 = true; return "xxxx"; }); } var newCode = doc.getValue(); code348 = newCode; $("textarea#stepcodeTextarea348").val(newCode); if(alreadyWriteCode348!=code348){ lastModifedTime348 = new Date().getTime(); $("#rendering348").show(); $("#rendered348").hide(); } // alert(doc.getValue()); }); $(".CodeMirror").addClass("form-control"); // var editor348 = CodeMirror.fromTextArea(, { // lineNumbers: true, // styleActiveLine: true, // matchBrackets: true, // theme:"eclipse", // }); editor348.on("change",function(doc){ // alert(doc.getValue()); }); $("#tryDiv348").hide(); }); $("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");


源代码
1. 双击选中单词 2. 三击选中整行 3. CTRL+F 查找 4. F8 全屏编辑,再次点击恢复
渲染中 渲染完成
效果


HOW2J公众号,关注后实时获知布最新的教程和优惠活动,谢谢。


关于 前端部分-HTML-表格 的提问

尽量提供截图代码异常信息,有助于分析和解决问题。 也可进本站QQ群交流: 620943819
提问尽量提供完整的代码,环境描述,越是有利于问题的重现,您的问题越能更快得到解答。
对教程中代码有疑问,请提供是哪个步骤,哪一行有疑问,这样便于快速定位问题,提高问题得到解答的速度
在已经存在的几千个提问里,有相当大的比例,是因为使用了和站长不同版本的开发环境导致的,比如 jdk, eclpise, idea, mysql,tomcat 等等软件的版本不一致。
请使用和站长一样的版本,可以节约自己大量的学习时间。 站长把教学中用的软件版本整理了,都统一放在了这里, 方便大家下载: http://how2j.cn/k/helloworld/helloworld-version/1718.html

上传截图