Fading Coder

One Final Commit for the Last Sprint

Home > Notes > Content

Building a Membership Login Interface with HTML Tables and CSS

Notes 1

Interface Overview

This login interface is constructed using HTML table elements and form tags to create a structured layout for user authentication.

Implementation Code

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Membership Login</title>
    <style>
        .login-container {
            margin: 50px auto;
            padding: 0;
        }
        .login-header {
            font-size: 20px;
            color: #4d5aa1;
        }
        .submit-button {
            width: 90px;
            height: 40px;
        }
        .link {
            color: rgb(56, 152, 56);
        }
        .link:visited {
            color: #9195ab;
        }
        .link:hover {
            color: blue;
            text-decoration: underline;
        }
    </style>
</head>
<body>
    <div class="login-container">
        <form action="#" method="post" name="loginForm">
            <table width="400" height="300">
                <tr>
                    <th colspan="2" class="login-header">Member Login</th>
                </tr>
                <tr>
                    <td>Username</td>
                    <td><input type="text" name="username" placeholder="Email/ID/Phone"></td>
                </tr>
                <tr>
                    <td><label for="passwordField">Password</label></td>
                    <td><input id="passwordField" type="password" name="password" placeholder="Password"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input type="checkbox" name="remember" checked>Remember me for 2 weeks</td>
                </tr>
                <tr>
                    <td></td>
                    <td class="button-section">
                        <input type="image" src="submit-button.png" class="submit-button">
                        <a href="#" class="link" target="_blank">Forgot Password?</a>
                    </td>
                </tr>
                <tr>
                    <td>Other Login Methods</td>
                    <td>
                        <a href="#" class="link" target="_blank">QQ Login</a>
                        <a href="#" class="link" target="_blank">Weibo Login</a>
                        <a href="#" class="link" target="_blank">Baidu Account</a>
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td><a href="#" class="link" target="_blank">Not a member? Register now</a></td>
                </tr>
            </table>
        </form>
    </div>
</body>
</html>

Code Explanation

  1. The structure begins with a div container that wraps the entire content, followed by a form element for handling user input, and a table to oragnize the layout.

  2. The table is organized with rows (tr) and cells (td), using this basic pattern:

<table>
  <tr>
    <td>Cell content</td>
  </tr>
</table>

Elements such as input fields, labels, and links are placed within the appropriate table cells.

  1. Form elements include text inputs for username and password, a checkbox for session persistence, and an image button for submission.

  2. CSS styling is applied to center the layout with margin: 50px auto, and to style links with hover effects. The table structure inherently handles alignment of elements, eliminating the need for additional positioning code.

Related Articles

Designing Alertmanager Templates for Prometheus Notifications

How to craft Alertmanager templates to format alert messages, improving clarity and presentation. Alertmanager uses Go’s text/template engine with additional helper functions. Alerting rules referenc...

Deploying a Maven Web Application to Tomcat 9 Using the Tomcat Manager

Tomcat 9 does not provide a dedicated Maven plugin. The Tomcat Manager interface, however, is backward-compatible, so the Tomcat 7 Maven Plugin can be used to deploy to Tomcat 9. This guide shows two...

Skipping Errors in MySQL Asynchronous Replication

When a replica halts because the SQL thread encounters an error, you can resume replication by skipping the problematic event(s). Two common approaches are available. Methods to Skip Errors 1) Skip a...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.