Skip to content

Commit ab298b9

Browse files
committed
fix: calculation tr list of table
1 parent 5a9aa58 commit ab298b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/table.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub fn table(Json(args): Json<Vec<Value>>) -> FnResult<String> {
4545
}
4646
};
4747
let mut result = String::from("");
48-
for i in 0..(elems.len() as i32 % col) {
48+
for i in 0..(elems.len() as i32 + col - 1) / col {
4949
let mut tr = String::from("");
5050
for j in 0..col {
5151
tr += &format!("<td>{}</td>", elems[(i * col + j) as usize]);

0 commit comments

Comments
 (0)