设置表列宽 [英] Setting table column width

查看:96
本文介绍了设置表列宽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用于收件箱的简单表格,如下所示:

I've got a simple table that is used for an inbox as follows:

<table border="1">
        <tr>
            <th>From</th>
            <th>Subject</th>
            <th>Date</th>
        </tr>

如何设置宽度,使From和Date为页面宽度的15%是70%。我还希望表格占据整个页面宽度。

How do I set the width so the From and Date are 15% of the page width and the Subject is 70%. I also want the table to take up the whole page width.

推荐答案

<table>
    <colgroup>
       <col span="1" style="width: 15%;">
       <col span="1" style="width: 70%;">
       <col span="1" style="width: 15%;">
    </colgroup>
    <!-- Put <thead>, <tbody>, and <tr>'s here! -->
</table>

这篇关于设置表列宽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆