Kaynağa Gözat

update element

fancl 2 yıl önce
ebeveyn
işleme
5c98f4b549
2 değiştirilmiş dosya ile 11 ekleme ve 2 silme
  1. 2 0
      element/table.go
  2. 9 2
      theme/default.go

+ 2 - 0
element/table.go

@@ -32,6 +32,7 @@ func (table *Table) String() string {
 	if table.Title != nil {
 		br.WriteString(renderTag(atom.Div.String(), Attrs{"class": "table-title"}, table.Title.Html()))
 	}
+	br.WriteString(beginTag(atom.Div.String(), Attrs{"class": "table-wrapper-inner"}))
 	br.WriteString(beginTag(atom.Table.String(), Attrs{"class": "table"}))
 	if len(table.Header) > 0 {
 		br.WriteString(beginTag(atom.Thead.String(), nil))
@@ -54,6 +55,7 @@ func (table *Table) String() string {
 		br.WriteString(endTag(atom.Tbody.String()))
 	}
 	br.WriteString(endTag(atom.Table.String()))
+	br.WriteString(endTag(atom.Div.String()))
 	if table.Outro != nil {
 		br.WriteString(table.Outro.Html())
 	}

+ 9 - 2
theme/default.go

@@ -42,6 +42,8 @@ func (theme *Default) Template() string {
 
     .container-inner {
       padding: 1rem;
+	  width: 100%;
+      box-sizing: border-box;
     }
 
 	.action-block{
@@ -52,7 +54,12 @@ func (theme *Default) Template() string {
 	.table-wrapper{
 		margin-bottom: 1.5rem;
 	}
-
+	
+	.table-wrapper-inner{
+		width: 100%;
+		overflow-x: auto;
+	}
+	
     .text-success {
       color: #20c55c;
     }
@@ -60,7 +67,7 @@ func (theme *Default) Template() string {
     .text-danger {
       color: #ff0476;
     }
-
+	
     .text-center {
       text-align: center;
     }