I need ideas on how to go about table layout problem. I want to set different width of the columns dependent on the picked language.
我需要关于如何处理表格布局问题的想法。我想根据选择的语言设置不同的列宽度。
3 个解决方案
#1
1
A variable switch, such as:
可变开关,例如:
<%
dim columnWidth
if session("lang") = "eng" then
columnWidth = 50
else
columnWidth = 100
end if
%>
<table>
<tr>
<td width="<%= columnWidth %>px">[content]</td>
</tr>
</table>
For c#, the code would be:
对于c#,代码将是:
<%
private int columnWidth;
if (session("lang") == "eng") {
columnWidth = 50;
} else {
columnWidth = 100;
}
%>
#2
3
You can have language specific CSS, and then simply load the appropriate CSS based on language.
您可以使用特定于语言的CSS,然后只需根据语言加载适当的CSS。
In the CSS you can add styles to your table for defining the layout.
在CSS中,您可以向表中添加样式以定义布局。
#3
1
Use if-else inside scriplet based on the currently selected language and place appropriate "td" tags.
根据当前选择的语言在scriplet中使用if-else,并放置适当的“td”标签。
Hope this is what you are looking for !
希望这就是你要找的!
#1
1
A variable switch, such as:
可变开关,例如:
<%
dim columnWidth
if session("lang") = "eng" then
columnWidth = 50
else
columnWidth = 100
end if
%>
<table>
<tr>
<td width="<%= columnWidth %>px">[content]</td>
</tr>
</table>
For c#, the code would be:
对于c#,代码将是:
<%
private int columnWidth;
if (session("lang") == "eng") {
columnWidth = 50;
} else {
columnWidth = 100;
}
%>
#2
3
You can have language specific CSS, and then simply load the appropriate CSS based on language.
您可以使用特定于语言的CSS,然后只需根据语言加载适当的CSS。
In the CSS you can add styles to your table for defining the layout.
在CSS中,您可以向表中添加样式以定义布局。
#3
1
Use if-else inside scriplet based on the currently selected language and place appropriate "td" tags.
根据当前选择的语言在scriplet中使用if-else,并放置适当的“td”标签。
Hope this is what you are looking for !
希望这就是你要找的!