Apache Tiles - 不使用表格布局时有用吗?
使用CSS布局比表格布局要好得多,
现在,所有Tiles示例都使用Table-Layout来插入图块
<table border="2" width="300" bordercolor="Gray">
<tr>
<td bgcolor="Blue"><strong><tiles:getAsString name="title"/></strong></td>
</tr>
<tr>
<td><tiles:insert attribute="header"/></td>
</tr>
<tr>
<td><tiles:insert attribute="body"/></td>
</tr>
</table>
我的问题是,使用它是无用/无意义的使用 CSS-Layout 时的 Tiles 框架?像这样的东西?或者..它会杀死瓷砖吗?
<body>
<div id="header">
<div id="headerTitle"><tiles:insertAttribute name="header" /></div>
</div>
<div id="content">
<tiles:insertAttribute name="body" />
</div>
<div id="footer">
<tiles:insertAttribute name="footer" />
</div>
</body>
?
谢谢
according to 13 Reasons Why CSS Is Superior to Tables in Website Design
it's much better use CSS layout than table layout ,
now , All Tiles examples uses Table-Layout to insert the tiles
<table border="2" width="300" bordercolor="Gray">
<tr>
<td bgcolor="Blue"><strong><tiles:getAsString name="title"/></strong></td>
</tr>
<tr>
<td><tiles:insert attribute="header"/></td>
</tr>
<tr>
<td><tiles:insert attribute="body"/></td>
</tr>
</table>
my question is , is it useless/pointless to use Tiles framework when using CSS-Layout ? something like this? or .. Does it kill Tiles?
<body>
<div id="header">
<div id="headerTitle"><tiles:insertAttribute name="header" /></div>
</div>
<div id="content">
<tiles:insertAttribute name="body" />
</div>
<div id="footer">
<tiles:insertAttribute name="footer" />
</div>
</body>
?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,它并没有消除它的需要。即使 div 的顺序并不重要(因为布局是通过 CSS 完成的),您也不希望在应用程序的每个 JSP 中重复页眉和页脚 div。 HTML 头也是您不想重复的内容。因此,最好将它们放在布局页面中,一劳永逸,而不是只将正文内容放在应用程序的每个页面中。
No, it doesn't eliminate its need. Even if the order of your divs is not important because the layout is done with CSS, you don't want to repeat the header and footer divs in every JSP of your application. The HTML head is also something you don't want to repeat. So it's still better to put them in a layout page, once and for all, ant to only put the body content in every page of the application.