I need to display a table in a web page. The data from the table comes from database which I can query using mysql php library. I am looking for a template/example of how to come up with a nice looking table (I am not good at front end design).

我需要在网页中显示一个表格。表中的数据来自数据库,我可以使用mysql php库查询。我正在寻找一个模板/示例,说明如何提出一个漂亮的表(我不擅长前端设计)。

Any link/example/references will be appreciated.

任何链接/示例/参考将不胜感激。

5 个解决方案

#1


5

Here is an example on how to read a MySQL table into a HTML table. And no, it does not look nice.

以下是如何将MySQL表读入HTML表的示例。不,它看起来不太好看。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>Read values from MySQL</title>
    </head>
    <body>
        <?
            mysql_connect($db_host,$db_user,$db_pw);
            mysql_select_db($db_name);
        ?>
        <table border="1">
            <tbody>
                <?
                    $result = mysql_query("SELECT firstname, lastname FROM persons")
                        OR die(mysql_error());
                    while($row = mysql_fetch_assoc($result)) {
                        echo '<tr><td>' . $row['firstname'] . '</td><td>' . $row['lastname'] . '</td></tr>';
                    }
                ?>
            </tbody>
        </table>
    </body>
</html>

更多相关文章

  1. 填充HTML表格列,两个边框?
  2. 网站开发进阶(二十五)js如何将html表格导出为excel文件
  3. 100%高度分区内显示:表格单元分区
  4. html 防止表格或div被撑开
  5. 怎样把Excel表格转换成html网页格式输出?急!!
  6. HTML之表格篇——表格的嵌套
  7. 第二个表格单元格未与顶部对齐
  8. 对于表格数据,什么渲染更快,CSS或?
  9. 经典炫酷的HTML5/jQuery动画应用示例及源码

随机推荐

  1. 如何在three.js中导入json和渲染
  2. iOS、Android、WebOS系统体系架构的比较
  3. 关于JavaScript方法,设置GridView中首项Ch
  4. 前端省市区(县)三级联动下拉框
  5. 在Internet Explorer中使用sprited按钮和
  6. touchableopacity onpress函数undefined(
  7. 将textarea值附加到现有数组javascript
  8. javascript 截取字符串方法汇总
  9. Javascript中的素数函数...多个语句
  10. [Effective JavaScript 笔记]第65条:不要