How to make a bilingual site without creating a separate ASP page for each language?
-
03-07-2019 - |
Question
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.
Solution
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:
<%
private int columnWidth;
if (session("lang") == "eng") {
columnWidth = 50;
} else {
columnWidth = 100;
}
%>
OTHER TIPS
You can have language specific CSS, and then simply load the appropriate CSS based on language.
In the CSS you can add styles to your table for defining the layout.
Use if-else inside scriplet based on the currently selected language and place appropriate "td" tags.
Hope this is what you are looking for !
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow