初学,有个关于HTML的问题_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 09:02:05
Original
1097 people have browsed it

联系到HTML表格的时候正好遇到一个问题,就是表格中一段话中,有几个数值需要调用函数比如
今天是星期2
这是表格的一行,而其中2是调用函数得到,那么这个表格的代码该怎么写


回复讨论(解决方案)

是问表格中部分列的值怎么动态获得内容?

是问表格中部分列的值怎么动态获得内容?

恩,是的

你不会写javascript吗?哪推荐你用一些代数据集成功能的html ui:dojo,yui,应该有很多吧。

<table id="tab" width="400" border="1">    <tr>        <td>今天是星期<b id="day"></b></td>    </tr></table><script>    function setWeek(){        var el = document.getElementById('day');        setDay(el);    }    setWeek();    function setDay(obj){        var d = new Date();        var arr = ['日','一', '二','三','四','五','六'];        var day = d.getDay();        obj.innerHTML = arr[day];    }</script>
Copy after login

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!