如何在asp页面中略微改变视图?

时间:2016-02-23 10:18:03

标签: html css asp.net

我有这个asp代码:

        <table>
            <tr>
                <td>Text:
                </td>
                <td>
                    <asp:TextBox ID="txtDescPoint" runat="server" EnableViewState="False" />                   
                </td>
                <td>
                  <input type="button" value="..." id="ffcolorswtach" style="width: 20px; height: 23px;color: #ffffffff; background-color: #ffffffff" onclick="PickColor(1, false, false)" role="button"/>
                </td>
            </tr>
            <tr>
                <td>X:
                </td>
                <td>
                    <asp:TextBox ID="txtLon" runat="server" EnableViewState="False" />
                </td>
                <td>&nbsp;

                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                        ControlToValidate="txtLon" Display="Dynamic" ErrorMessage="*"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>Y:
                </td>
                <td>
                    <asp:TextBox ID="txtLat" runat="server" EnableViewState="False" />
                </td>
                <td>&nbsp;

                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                        ControlToValidate="txtLat" Display="Dynamic" ErrorMessage="*"></asp:RequiredFieldValidator>
                </td>
            </tr>
        </table>

在这里看起来如何:

enter image description here

我需要这样的观点:

enter image description here

我的问题是我需要在asp代码中进行哪些更改以使其外观如上图所示?

1 个答案:

答案 0 :(得分:1)

我是ASP的新手,但我认为你可以使用CSS / html样式原则。

package pe2;

import java.util.Scanner;

public class PE2 {

  public static void main(String[] args) {
    double beginKapitaal = 0;
    double jaarlijkseRente = 0;
    double rente = 0;
    double afbetalingsDuur = 0;
    int aantalJaren = 0;
    double annuiteit = 0;
    double interest;
    double aflossing;

    double[] uitstaandeLening;
    double[] interesten;
    double[] aflossingen;

    Scanner input = new Scanner(System.in);

    for (int i = 0; i < 5;) {
        System.out.println("Wat is het beginkapitaal?");
        beginKapitaal = input.nextDouble();
        if (beginKapitaal <= 0) {
            System.out.println("Het beginkapitaal moet groter zijn dan 0");
        } else {
            i = 5;
        }
    }
    for (int i = 0; i < 5;) {
        System.out.println("Wat is de jaarlijkse rente?");
        jaarlijkseRente = input.nextDouble();

        if (jaarlijkseRente <= 0) {
            System.out.println("De jaarlijkse rente moet groter zijn dan 0");
        } else {
            i = 5;
        }
    }
    for (int i = 0; i < 5;) {
        System.out.println("In hoeveel jaar zal de lening afbetaald worden?");
        afbetalingsDuur = input.nextDouble();
        aantalJaren = (int) afbetalingsDuur + 1;
        if (afbetalingsDuur <= 0) {
            System.out.println("De afbetalingsduur moet groter zijn dan 0");
        } else {
            i = 5;
        }
    }

    rente = jaarlijkseRente / 100;

    input.close();

    annuiteit = beginKapitaal * (rente / (1 - (1 / Math.pow(rente + 1, afbetalingsDuur))));

    System.out.printf("Beginkapitaal: " + "%.2f", beginKapitaal);
    System.out.printf("\nIntrest: " + "%.2f", jaarlijkseRente);
    System.out.printf("\nAfbetalingsduur in jaren: " + "%.1f", afbetalingsDuur);
    System.out.printf("\nAnnuïteit: " + "%.2f", annuiteit);

    uitstaandeLening = new double[aantalJaren];
    interesten = new double[aantalJaren];
    aflossingen = new double[aantalJaren];
    //interest = beginKapitaal * rente;
    //aflossing = annuiteit - interest;

    for (int i = 0; i < aantalJaren; i++) {

        uitstaandeLening[i] = beginKapitaal - aflossingen[i];
        interesten[i] = beginKapitaal * rente;
        aflossingen[i] = annuiteit - interesten[i];

        if (i == 0) {
            System.out.printf("\n\nJaar" + "\tUitstaande lening" + "\tInteresten" + "\t\tAflossing");
        } else if (i == 1) {
            System.out.printf("\nJaar " + i + "\t" + uitstaandeLening[i] + "\t\t" + "%.2f" , interesten[i] + "\t\t" + "%.2f",
                    aflossingen[i]);
            beginKapitaal = beginKapitaal - aflossingen[i];
        } else {

            System.out.printf("\nJaar " + i + "\t" + uitstaandeLening[i] + "\t" + interesten[i] + "\t" + "%.2f",
                    aflossingen[i]);

            beginKapitaal = beginKapitaal - aflossingen[i];
        }

    }

  }

}

在style =

之后的引号之间添加此内容
 <input type="button" value="..." id="ffcolorswtach" style="width: 20px; height: 23px;color: #ffffffff; background-color: #ffffffff" onclick="PickColor(1, false, false)" role="button"/>

如果您无法使按钮足够接近,可能是因为文本框周围有填充或边距。搜索您的css文件以获取对#txtDescPoint的引用,并编辑padding / margin属性(如果有)。

相关问题