table with a tr of a single td

0

Good, I want my table in html to be with only one column in a row, something like a title, similar to this:

I mean the cell that says Sign Up, the code in it is the following:

<-tr>
    <-td align="center" colspan="2">Sign Up</td>  
    <-asp:Label runat="server" Text="Sign Up"></asp:Label>  
<-/tr> 

Add the scripts before the start of the tag so that they are not interpreted by the text box.

Why add the asp: Label?
Because this happens if I remove it:

Complete code:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SignUp.aspx.cs" Inherits="SignUpn" %>

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SignUp.aspx.cs" Inherits="SignUpn" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<script type="text/javascript">
    function alerta(numero) {
        alert("Hay un campo vacío.");
    }
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
    <table bgcolor="#1abc9c" border="1">

        <tr>
            <td align="center" colspan="2">Sign Up</td>
            <asp:Label runat="server" Text="Sign Up"></asp:Label>
        </tr>

        <tr>
            <td align="left">
                <asp:Label ID="Label2" runat="server" Text="Name"></asp:Label>
            </td>
            <td align="center">
                <asp:TextBox ID="textBoxName" MaxLength="16" runat="server" Width="100%"></asp:TextBox>
            </td>
        </tr>

        <tr>
            <td align="left">
                <asp:Label ID="Label3" runat="server" Text="Last name"></asp:Label>
            </td>

            <td align="center">
                <asp:TextBox ID="textBoxLastName" MaxLength="16" runat="server" Width="100%"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="left">
                <asp:Label ID="Label1" runat="server" Text="Password"></asp:Label>
            </td>

            <td align="center">
                <asp:TextBox ID="textBoxPassword" TextMode="Password" MaxLength="16" runat="server" Width="100%" ></asp:TextBox>
            </td>
        </tr>

        <tr>
            <td align="left">
                <asp:Label ID="Label5" runat="server" Text="Re-password"></asp:Label>
            </td>

            <td align="center">
                <asp:TextBox ID="textBoxRePassword" TextMode="Password" runat="server" Width="100%"></asp:TextBox>
            </td>
        </tr>

         <tr>
            <td align="left">
                <asp:Label ID="Label4" runat="server" Text="E-mail"></asp:Label>
            </td>

            <td align="center">
                <asp:TextBox ID="textBoxEmail" TextMode="Email" MaxLength="32" runat="server" Width="100%"></asp:TextBox>
            </td>
        </tr>

        <tr>
            <td align="center">
                <asp:Label runat="server" Text="Type of account"></asp:Label>
            </td>

            <td>
                <asp:RadioButtonList runat="server" ID="radioListTypes" >
                    <asp:ListItem Selected="True">Commercial</asp:ListItem>
                    <asp:ListItem>Personal</asp:ListItem>
                </asp:RadioButtonList>

            </td>
        </tr>




        <tr>
            <td>
                <asp:Button ID="buttonCancel" runat="server" Text="Cancel" Width="100%"/>
            </td>
            <td>
                <asp:Button ID="buttonSignUp" runat="server" Text="OK" Width="100%" OnClick="buttonSignUp_Click"/>
            </td>
        </tr>
    </table>
</div>

</form>

</body>

I would appreciate the clarification.

    
asked by Parzival 30.09.2017 в 22:40
source

1 answer

1

Try to put it in the following way:

<-tr>
    <-td align="center" colspan="2">
        <-asp:Label runat="server" Text="Sign Up"></asp:Label>
    </td>
<-/tr> 
    
answered by 01.10.2017 в 04:24