How to set the width of the page?

…衆ロ難τιáo~ 提交于 2019-12-11 05:11:27

问题


I have been trying to increase the width of pdf but nothing seems to work:

<style type="text/css">
@page {
    size: a4 landscape;
    width: 27cm;  /* not working */
    @frame content {
        top: 2cm;
        width: 27cm;  /* not working */
        margin-left: 1.5cm;  /* changing these values work!! */
        margin-bottom: 2cm;  /* changing these values work!! */
    }
}
</style>

No matter what I try, the content width doesn't seem to increase. All my <div>, <tables> are at 100%, and reducing the margin increases the size of the table, so the 100% is probably working. But how to increase the width of the main container? From what I can deduce, it looks like it is keeping to some default width, and it does not increase, because both portrait and landscape result in the same width content.

Anyone got any ideas?

来源:https://stackoverflow.com/questions/45534895/how-to-set-the-width-of-the-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!