似乎我非常清楚地解释了我的问题,但是我的标签上的网格功能存在问题。标签确实显示了,但是我无法更改其行/列或括号内的任何功能。
我在其中放置了如何复制问题的代码。如前所述,将任何内容放在.grid()括号内均无济于事
from tkinter import *
root = Tk()
#To actually see that it does not work
root.geometry("800x600")
Var = StringVar()
Label = Label(root, textvariable=Var)
#Location of problem, adding stuff into the brackets does not change anything. For example: sticky = "ne"
Label.grid()
Var.set("Ha")
root.mainloop()
答案 0 :(得分:0)
要使标签显示在右侧,可以指定网格中的列数,然后将标签放置在最后一列中。例如,尝试在您的“问题的#位置”注释之后添加此代码:
class AdminEmailSignups extends Component {
constructor()
{
super();
this.state={ data:[], }
}
componentDidMount()
{
fetch('api/contact').
then((Response)=>Response.json()).
then((findresponse)=>
{
this.setState({ data:findresponse, })
})
}
render()
{
return (
<div className="app flex-row adminsections ">
<Table striped bordered condensed hover responsive>
{
this.state.data.map(function(blog){
return <tbody>
<tr>
<td><span>{blog.slider.title}</span></td>
</tr>
</tbody>
})
}
</Table>
</div>
);
}
}