Skip to content

Commit

Permalink
stylise table and reduce font paragraph size
Browse files Browse the repository at this point in the history
  • Loading branch information
firm1 committed Mar 9, 2016
1 parent 8e19eb3 commit aac5c65
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/com/zestedesavoir/zestwriter/view/TableController.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ public void handle(CellEditEvent<ZRow, String> t) {
row.set(t.getTablePosition().getColumn(), t.getNewValue());
}
});
tc.setPrefWidth(100);
tc.setPrefWidth(150);
TextField txf = new TextField();
txf.setPrefWidth(100);
txf.setPrefWidth(150);
txf.setPromptText("Colonne "+(tableView.getColumns().size()+1));
tc.setGraphic(txf);
tableView.getColumns().addAll(tc);
Expand Down
7 changes: 6 additions & 1 deletion src/com/zestedesavoir/zestwriter/view/TableEditor.fxml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import java.lang.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.BorderPane?>
<BorderPane prefHeight="300.0" prefWidth="400.0" xmlns="http://javafx.com/javafx/8.0.40" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.zestedesavoir.zestwriter.view.TableController">

<BorderPane prefHeight="400.0" prefWidth="600.0" stylesheets="@dark.css" xmlns="http://javafx.com/javafx/8.0.40" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.zestedesavoir.zestwriter.view.TableController">
<center>
<TableView fx:id="tableView" editable="true" prefHeight="300.0" prefWidth="400.0" BorderPane.alignment="CENTER" />
</center>
Expand Down
41 changes: 39 additions & 2 deletions src/com/zestedesavoir/zestwriter/view/content.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ b, optgroup, strong {

body {
font-family: Merriweather,"Liberation Serif","Times New Roman",Times,Georgia,FreeSerif,serif;
font-size: 1rem;
line-height: 1.3em;
font-size: 0.9em;
line-height: 1.9em;
background-color: #F7F7F7;
}

h3{
font-size: 18px;
margin-bottom: 12px;
Expand Down Expand Up @@ -329,4 +330,40 @@ kbd {
border-bottom-width: 3px;
text-shadow: 0 1px 0 #fff;
color: #5e551f;
}

/* Tables */

.table-wrapper {
max-width: 100%;
overflow: auto;
}

table {
margin: 15px 0;
border-top: 1px solid #ddd;
}
table {
border-collapse: collapse;
border-spacing: 0;
}

table thead {
background: #ddd;
color: #084561;
}
table td:first-child, table th:first-child {
border-left: 1px solid #ddd;
}
table td, table th {
text-align: left;
padding: 5px 15px 5px 7px;
border-right: 1px solid #ddd;
}
table tbody tr:nth-child(2n+1) {
background: #f7f7f7;
}
table tbody tr {
background: #fdfdfd;
border-bottom: 1px solid #ddd;
}
5 changes: 5 additions & 0 deletions src/com/zestedesavoir/zestwriter/view/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@
.menu-bar {
-fx-border-color: #DDD #DDD #F8AD32 #DDD;
-fx-border-width: 0 0 3px 0;
}

.table-row-cell {
-fx-cell-size: 80px;
-fx-padding: 20 5 20 5;
}

0 comments on commit aac5c65

Please sign in to comment.