小编use*_*308的帖子

当td内容太宽时,表会溢出父div

我准备了一个JSFiddle来解释/告诉你我的问题:http://jsfiddle.net/nz96C/

它起初看起来还不错,但是当我#firsttd在整个表中添加一些文本时,一旦使用tds整个宽度,就会溢出父div.我知道如何用CSS(#firstdiv {width:90px;overflow:hidden;})解决这个问题,但我不知道确切的像素数(百分比不起作用).另外我不希望第一个td中的文本换行.

我希望你能解决我的问题,我甚至无法用我的第一语言解释它.

编辑:我的目标是有一个表,其中第一个td中的文本有多长并不重要,表永远不会溢出父div - 没有文本被包装.我希望第一个td溢出的文本不显示.

css html-table overflow width

10
推荐指数
1
解决办法
1万
查看次数

Google Cloud Functions (Python) 中的随机连接错误

因为过去几周我的浏览器控制台中出现了一些意外的 CORS 错误,所以我在 Google Cloud Functions 中设置了一个超级简单的 Python 脚本,其中包含一个函数:

def prepData(request):

    if request.method == 'OPTIONS':
        headers = {
            'Access-Control-Allow-Origin': '*',
            'Access-Control-Allow-Methods': 'POST',
            'Access-Control-Allow-Headers': 'Content-Type',
            'Access-Control-Max-Age': '3600'
        }
        return ('', 204, headers)

    headers = {
        'Access-Control-Allow-Origin': '*'
    }
    return ("", 200, headers)
Run Code Online (Sandbox Code Playgroud)

它看起来与 Google 在其文档页面上提供的功能非常相似,但有一个主要区别:我使用的是 POST 而不是 GET。

调用该函数时,我Function execution took 13 ms, finished with status code: 200在大约 50% 的情况下看到成功消息 ( ),Function execution took 11 ms, finished with status: 'connection error'在所有其他情况下看到连接错误 ( )。每当我在 GCF 中遇到连接错误时,Chrome …

python xmlhttprequest google-cloud-platform google-cloud-functions

2
推荐指数
1
解决办法
824
查看次数