开发者

PlaceHolderMain controlling td width of hard-coded values

开发者 https://www.devze.com 2022-12-31 12:49 出处:网络
In my custom .master page I have the following code: <asp:ContentPlaceHolder id=\"PlaceHolderMain\" runat=\"server\" Visible=\"true\" />

In my custom .master page I have the following code:

<asp:ContentPlaceHolder id="PlaceHolderMain" runat="server" Visible="true" />

This prints out the main content of my page. It contains this structure

<table ID="OuterZoneTable" width="100%">
    <tr>...</tr>
    <tr id="OuterRow">
        <td width="80%" id="OuterLeftCell">...</td>
        <td width="180" id="Oute开发者_如何学PythonrRightCell">...</td>
    </tr>
    ...
</table>

I want to control the width of #OuterLeftCell and #OuterRightCell but it is hard-coded in the html that is returned. How would I change these values?


You should be able to easily override the inline settings via CSS. For example, here is the equivalent CSS for the current inline settings (define in the HEAD section of your page, via your .master or a page layout):

<style type="text/css">
    #OuterZoneTable {
        /* Control overall table width */
        width: 100%;
    }

    #OuterLeftCell {
        width: auto;
    }

    #OuterRightCell {
        width: 180px;
    }
</style>

Now if you wanted to make both cells take up half the available space, you'd change their definitions both to be width:50%. Hope this gets you started in the right direction.

0

精彩评论

暂无评论...
验证码 换一张
取 消