【问题标题】:HTML table/column width is not working when used as email body in C#在 C# 中用作电子邮件正文时,HTML 表格/列宽不起作用
【发布时间】:2015-11-20 02:44:34
【问题描述】:

我有一个包含一个表格的 html 文件,它有大约 20 列。我想将表格宽度设置得更大,以便包含内容的列更宽。

这是我的表结构

<table border="1" cellpadding="2" cellspacing="0" id="tblBody" style="table-layout: fixed;width:5000px">
    <tr>
        <td  style="overflow: hidden;width:500px;">
                            column width 500px
        </td>
        <td>

        </td>
        .
.
.
.
.
.
.
.
.
.
        <td>
        </td>
    </tr>
</table>

当我在浏览器中查看时,它正确显示了结构,但是当我在 c# 应用程序的电子邮件正文中使用此 html 时,它不起作用。

有人可以帮我解决这个问题吗?

【问题讨论】:

  • 应用overflow: hidden;td 没有任何作用。

标签: c# html css asp.net .net


【解决方案1】:

当我为每个单元格应用边距并将表格宽度设置为自动时,它可以工作。

【讨论】:

    猜你喜欢
    • 2017-07-04
    • 2014-07-04
    • 2015-06-28
    • 2016-12-14
    • 2015-04-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多