html - 表格格式问题

标签 html css html-table

我在格式化我正在创建的表格时遇到了一些困难。我想要我的 <th>去整个 table 的宽度和两个<tr>的。即使我有我的第一个 <td>宽度设置为 200px,它和我的 <th> 一样多.

https://jsfiddle.net/bL47ro78/

我怎样才能得到..

 <th class="view_topic_th">
    <td>Date</td>
</th>

和我的 table 一样宽,<tr?的。

最佳答案

以下是可以帮助您格式化表格的解决方案:

<table class="forum_view_topic_table"> 
    <tr calss="view_topic_th">
            <th class="view_topic_th_left" align="right">Date</th> 
            <th class="view_topic_th_right">Count</th> 
        </tr>
    <tr>
        <td width='200' valign='top' align='center' style='border: 1px solid #000000;'>User Info Here!</td>
        <td valign='top' style='border: 1px solid #000000'>
            <div style='min-height: 125px;'>Post 1
                <br />by John Smith
                <hr />Content</div>
        </td>
    </tr>
    <tr>
        <td colspan='2'>
            <hr />
        </td>
    </tr>
    <?php } ?>
</table>

http://jsfiddle.net/bL47ro78/10/

关于html - 表格格式问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32063513/

相关文章:

javascript - 使 KML/KMZ 层透明/不透明

html - 在 IE7+ 中网页和打印预览中的不同字段宽度

html - <table> 具有固定的 <thead> 和可滚动的 <tbody>

html - 打开浏览器窗口或选项卡后,如何给它一个 "name"?

javascript - 样式表仍然在文本 : decoration is set to none 之后的按钮 div 中显示下划线

javascript - 使用 Javascript 对象动态创建 html 表

html - 社交媒体图标不可见

php - 忽略 Assets lessphpfilter中的.css文件

jquery - 单击表行时如何获取数据属性

html - Twitter-bootstrap 3. 在 Opera 中悬停后,一行表格失去边框