大佬教程收集整理的这篇文章主要介绍了GWT – 让CellTable Cell使用HTML吗?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
Textcolumn<MyCell> column1 = new Textcolumn<MyCell>() { @Override public String getValue(MyCell myCell) { String result = " " +myCell.getValue(); return result; } }; table.addcolumn(column1,"Header1");
我知道这可以使用css完成,但我只是想知道如何将HTML代码放在单元格中.任何帮助表示赞赏!
final SafeHtmlCell progressCell = new SafeHtmlCell(); column<UischeduledTask,SafeHtml> progressCol = new column<UischeduledTask,SafeHtml>( progressCell) { @Override public SafeHtml getValue(UischeduledTask value) { SafeHtmlBuilder sb = new SafeHtmlBuilder(); float percent = new Float(value.getCompleted()) / new Float(value.getAll()); int rounded = Math.round(percent * 100); sb.appendHtmlConstant("<div style='width: 100px; height: 20px; position: relative;'>"); sb.appendHtmlConstant("<div style='z-index: 2; display: inline; width: 100px; position: absolute; left: 0px,top: 0px; text-align: center;'>" + value.getCompleted() + "/" + value.getAll() + "</div>"); sb.appendHtmlConstant("<div style='position: absolute; left: 0; top: 0; width: 100px; z-index: 1'><div style='display: inline; float: left; width: " + rounded + "%; height: 20px; BACkground-color: #82cd80;'></div>"); sb.appendHtmlConstant("<div style='display: inline; float: right; width: " + (100 - rounded) + "%; height: 20px; BACkground-color: #c54c4d;'></div></div>"); sb.appendHtmlConstant("</div>"); return sb.toSafeHtml(); } };
以上是大佬教程为你收集整理的GWT – 让CellTable Cell使用HTML吗?全部内容,希望文章能够帮你解决GWT – 让CellTable Cell使用HTML吗?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。