Jump to content

Recommended Posts

Posted

Boas.

Gostaria de solicitar uma ajuda s.f.f.

Como posso criar uma class para webform para ficar com um elemento HTML do tipo Table com 9 linhas e duas colunas; para as linhas 1 a 8 defina a largura da 1ª coluna para 125px; defina a altura da última linha para 60px e o alinhamento vertical como Bottom.

Para ficar tudo alinhado e certo, e que já fiz table e não esta alinhado.

Obrigado

Posted
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="controlos1.aspx.cs" Inherits="controlos1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
   <title></title>
   <style type="text/css">
    .auto-style1 {
	    width: 714px;
    }
    .auto-style2 {
    }
   </style>
</head>
<body>
   <form id="form1" runat="server">
   <div>

    <table style="width: 100%; height: 450px;">
	    <tr>
		    <td class="auto-style1">
   <div style="width: 713px" class="auto-style2">

    <br />
    <strong>Controlos e Validação</strong><br />
    <br />

    Nome
    <asp:TextBox ID="txt_nome" runat="server" Width="400px" MaxLength="1000"></asp:TextBox>
 <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txt_nome" Display="Dynamic" ErrorMessage="RequiredFieldValidator">Obrigatório</asp:RequiredFieldValidator>
			    </div>
    <p class="auto-style2">
	    Morada <asp:TextBox ID="txt_morada" runat="server" Width="400px" MaxLength="2000"></asp:TextBox>
	    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txt_morada" Display="Dynamic" ErrorMessage="RequiredFieldValidator">Obrigatório</asp:RequiredFieldValidator>
    </p>
    <p class="auto-style2">
	    Código postal
	    <asp:TextBox ID="txt_codigo_postal" runat="server" Width="150px" MaxLength="8"></asp:TextBox>
	     <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="txt_codigo_postal" Display="Dynamic" ErrorMessage="RequiredFieldValidator">Obrigatório</asp:RequiredFieldValidator>
 
	    <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ControlToValidate="txt_codigo_postal" Display="Dynamic" ErrorMessage="RegularExpressionValidator" ValidationExpression="\d{4}\-\d{3} ">Formato - 1111-111</asp:RegularExpressionValidator>
    </p>
    <p class="auto-style2">
	    Localidade
	    <asp:TextBox ID="txt_localidade" runat="server" Width="400px" MaxLength="1000"></asp:TextBox>
	    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txt_localidade" Display="Dynamic" ErrorMessage="RequiredFieldValidator">Obrigatório</asp:RequiredFieldValidator>
    </p>
    <p class="auto-style2">
	    Telefone
	    <asp:TextBox ID="txt_telefone" runat="server" Width="150px" MaxLength="16"></asp:TextBox>
	    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txt_telefone" Display="Dynamic" ErrorMessage="RequiredFieldValidator">Obrigatório</asp:RequiredFieldValidator>
    </p>
    <p class="auto-style2">
	    Telemóvel
	    <asp:TextBox ID="txt_telemovel" runat="server" Width="150px" MaxLength="16"></asp:TextBox>
	    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txt_telefone" Display="Dynamic" ErrorMessage="RequiredFieldValidator">Obrigatório</asp:RequiredFieldValidator>
    </p>
    <p class="auto-style2">
	    Email
	    <asp:TextBox ID="txt_email" runat="server" Width="400px" MaxLength="250"></asp:TextBox>
	    <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ControlToValidate="txt_email" Display="Dynamic" ErrorMessage="RequiredFieldValidator">Obrigatório</asp:RequiredFieldValidator>
 
	    <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ControlToValidate="txt_email" Display="Dynamic" ErrorMessage="RegularExpressionValidator" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)* ">Formato - Email</asp:RegularExpressionValidator>
    </p>
    <p class="auto-style2">
	    NIF
	    <asp:TextBox ID="txt_nif" runat="server" Width="150px" MaxLength="9"></asp:TextBox>
	    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txt_nif" Display="Dynamic" ErrorMessage="RequiredFieldValidator">Obrigatório</asp:RequiredFieldValidator>
    </p>
			    <p>
				     </p>
			    <p>
				    <asp:Button runat="server" Text="validar dados" ID="bt_validar" />
    </p>
			    <p>
				     </p>
			    <p>
				     </p>
		    </td>
		    <td> </td>
		    <td> </td>
	    </tr>
	    <tr>
		    <td class="auto-style1"> </td>
		    <td> </td>
		    <td> </td>
	    </tr>
	    <tr>
		    <td class="auto-style1"></td>
		    <td></td>
		    <td></td>
	    </tr>
    </table>
    </div>
    <p>
	     </p>
   </form>
</body>
</html>
Posted

Tens o código:

<table>
 <tr>
   <td>Cell A</td>
   <td>Cell B</td>
 </tr>
</table>

No css vais ter algo como:

tr{height:40px;}
td{width:80px;}

Mas podes criar uma class do tipo:

<table>
 <tr class="classTr">
   <td>Cell A</td>
   <td>Cell B</td>
 </tr>
</table>

e no css:

.classTr{height:40px;}

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.