I'm using Flask-Table
and I don't know how to change the html
design of the table. Does anybody know how I do so?
Asked
Active
Viewed 573 times
-1

Paul Higazi
- 197
- 13

Roii Zmora
- 39
- 6
-
Can you provide some more details, images or other insigths? – Paul Higazi Apr 22 '20 at 14:53
-
Here is the link to the documentation, [https://flask-table.readthedocs.io/en/stable/]. @PaulHigazi – Roii Zmora Apr 22 '20 at 14:58
1 Answers
0
In order to add CSS design you will need a CSS class as such:
table.blueTable {
border: 1px solid #4169E1;
background-color: #008CBA;
width: 100%;
text-align: left;
border-collapse: collapse;
}
table.blueTable td, table.blueTable th {
border: 1px solid #AAAAAA;
padding: 3px 2px;;
}
table.blueTable tbody td {
font-size: 13px;
}
table.blueTable tr:nth-child(even) {
background: #15AAE1;
}
table.blueTable thead {
background: #1C6EA4;
background: -moz-linear-gradient(top, #5592bb 0%, #327cad 66%, #1C6EA4 100%);
background: -webkit-linear-gradient(top, #5592bb 0%, #327cad 66%, #1C6EA4 100%);
background: linear-gradient(to bottom, #5592bb 0%, #327cad 66%, #1C6EA4 100%);
border-bottom: 2px solid #444444;
}
table.blueTable thead th {
font-size: 15px;
font-weight: bold;
color: #E1E1E1;
border-left: 2px solid #D0E4F5;
}
table.blueTable thead th:first-child {
border-left: none;
}
table.blueTable tfoot td {
font-size: 14px;
}
table.blueTable tfoot .links {
text-align: right;
}
table.blueTable tfoot .links a{
display: inline-block;
background: #1C6EA4;
color: #FFFFFF;
padding: 2px 8px;
border-radius: 5px;
}
And you will need to apply the class to the table as seen in this code:
room_table = User_Room_Table(items=RoomHelper.get_by_user(user_name=current_user.username), border=11,
classes=['blueTable']

Roii Zmora
- 39
- 6