Commit 73403791 by Patryk Czarnik

Przykładowy styl dla tabeli z danymi klienta.

parent 95056d93
...@@ -6,17 +6,18 @@ ...@@ -6,17 +6,18 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Klient ${customer.name}</title> <title>Klient ${customer.name}</title>
<link rel="stylesheet" type="text/css" href="/styl.css"/> <c:url var="style_url" value="/styl.css"/>
<link rel="stylesheet" type="text/css" href="${style_url}"/>
</head> </head>
<body> <body>
<h1>Klient ${customer.name}</h1> <h1>Klient ${customer.name}</h1>
<table> <table class="data-table">
<tr><td>Email:</td><td>${customer.customerEmail}</td></tr> <tr><th>Email:</th><td>${customer.customerEmail}</td></tr>
<tr><td>Nazwa:</td><td>${customer.name}</td></tr> <tr><th>Nazwa:</th><td>${customer.name}</td></tr>
<tr><td>Numer tel:</td><td>${customer.phoneNumber}</td></tr> <tr><th>Numer tel:</th><td>${customer.phoneNumber}</td></tr>
<tr><td>Adres:</td><td>${customer.address}</td></tr> <tr><th>Adres:</th><td>${customer.address}</td></tr>
<tr><td>Miasto:</td><td>${customer.postalCode} ${customer.city}</td></tr> <tr><th>Miasto:</th><td>${customer.postalCode} ${customer.city}</td></tr>
</table> </table>
</body> </body>
......
...@@ -2,20 +2,27 @@ ...@@ -2,20 +2,27 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags" %> <%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
<!DOCTYPE html> <!DOCTYPE html>
<%-- W tym pliku używam tagów c:url do generowania adresów, które są poprawne niezależnie od miejsca zdeployowania aplikacji.
Obojętnie, czy aplikacja działabezpośrednio pod adresem localhost:8080/ , czy w jakimś podkatalogu (ma niepusty "context-path"),
- adresy są odpowiednio poprawiane.
Jest to jednak nieco pracochłonne w zapisie, dlatego jest to tylko w tym jednym pliku.
--%>
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Lista klientów</title> <title>Lista klientów</title>
<link rel="stylesheet" type="text/css" href="/styl.css"/> <c:url var="style_url" value="/styl.css"/>
<link rel="stylesheet" type="text/css" href="${style_url}"/>
</head> </head>
<body> <body>
<h1>Lista klientów</h1> <h1>Lista klientów</h1>
<table> <table class="data-table">
<tr><td>Email:</td><td>Nazwa:</td><td>Numer tel:</td><td>Adres:</td><td>Miasto:</td></tr> <tr><th>Email</th><th>Nazwa</th><th>Telefon</th><th>Adres</th><th>Miasto</th></tr>
<c:forEach var="customer" items="${customers}"> <c:forEach var="customer" items="${customers}">
<c:url var="adr" value="/customers/${customer.customerEmail}"/>
<tr> <tr>
<td>${customer.customerEmail}</td> <td><a href="${adr}">${customer.customerEmail}</a></td>
<td>${customer.name}</td> <td>${customer.name}</td>
<td>${customer.phoneNumber}</td> <td>${customer.phoneNumber}</td>
<td>${customer.address}</td> <td>${customer.address}</td>
...@@ -23,6 +30,5 @@ ...@@ -23,6 +30,5 @@
</tr> </tr>
</c:forEach> </c:forEach>
</table> </table>
</body> </body>
</html> </html>
...@@ -128,3 +128,22 @@ div.action { ...@@ -128,3 +128,22 @@ div.action {
max-height: 200px; max-height: 200px;
margin: 5px; margin: 5px;
} }
.data-table {
border-collapse: collapse;
border: 2px solid black;
background-color: #AAFFEE;
margin: 1em 100px;
}
.data-table th, .data-table td {
font-size: 0.95em;
padding: 2px 4px;
text-align: center;
border: 1px solid black;
}
.data-table th {
font-weight: bold;
background-color: #EE88DD;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment