我有一张表格。
如何在第二个屏幕截图中排列字段?此外,如果有人有任何其他提示,使它看起来更好(如使下拉框相同的大小),这将是很棒的。
<body>
<form action="/action_page.php">
<input type="checkbox" name="JAILdead" value="dead"> Jailor:
<input type="text" name="TIname">
<br>
<input type="checkbox" name="TIdead" value="dead"> Town Investigative:
<select name="TI">
<option value=" "> </option>
<option value="sheriff">Sheriff</option>
<option value="invest">Investigator</option>
<option value="spy">Spy</option>
</select>
<input type="text" name="TIname">
<br>
<input type="checkbox" name="TPdead" value="dead"> Town Protective:
<select name="TP">
<option value=" "> </option>
<option value="bg">Bodyguard</option>
<option value="doctor">Doctor</option>
</select>
<input type="text" name="TPname">
<br>
<input type="checkbox" name="TKdead" value="dead"> Town Killing:
<select name="TK">
<option value=" "> </option>
<option value="vet">Veteran</option>
<option value="vig">Vigilante</option>
</select>
<input type="text" name="TKname">
<br>
<input type="checkbox" name="TSdead" value="dead"> Town Support:
<select name="TS">
<option value=" "></option>
<option value="mayor">Mayor</option>
<option value="mayor">Medium</option>
<option value="ret">Retributionist</option>
<option value="trans">Transporter</option>
<option value="escort">Escort</option>
</select>
<input type="text" name="TSname">
<br>
<input type="checkbox" name="RTdead" value="dead"> Random Town:
<select name="RT">
<option value=" "> </option>
<option value="sheriff">Sheriff</option>
<option value="invest">Investigator</option>
<option value="spy">Spy</option>
<option value="bg">Bodyguard</option>
<option value="doctor">Doctor</option>
<option value="vet">Veteran</option>
<option value="vig">Vigilante</option>
<option value="mayor">Mayor</option>
<option value="mayor">Medium</option>
<option value="ret">Retributionist</option>
<option value="trans">Transporter</option>
<option value="escort">Escort</option>
</select>
<input type="text" name="RTname">
<br>
<input type="checkbox" name="RTdead" value="dead"> Random Town:
<select name="RT">
<option value=" "> </option>
<option value="sheriff">Sheriff</option>
<option value="invest">Investigator</option>
<option value="spy">Spy</option>
<option value="bg">Bodyguard</option>
<option value="doctor">Doctor</option>
<option value="vet">Veteran</option>
<option value="vig">Vigilante</option>
<option value="mayor">Mayor</option>
<option value="mayor">Medium</option>
<option value="ret">Retributionist</option>
<option value="trans">Transporter</option>
<option value="escort">Escort</option>
</select>
<input type="text" name="RTname">
<br>
<input type="checkbox" name="RTdead" value="dead"> Random Town:
<select name="RT">
<option value=" "> </option>
<option value="sheriff">Sheriff</option>
<option value="invest">Investigator</option>
<option value="spy">Spy</option>
<option value="bg">Bodyguard</option>
<option value="doctor">Doctor</option>
<option value="vet">Veteran</option>
<option value="vig">Vigilante</option>
<option value="mayor">Mayor</option>
<option value="mayor">Medium</option>
<option value="ret">Retributionist</option>
<option value="trans">Transporter</option>
<option value="escort">Escort</option>
</select>
<input type="text" name="RTname">
<br>
<input type="checkbox" name="RTdead" value="dead"> Random Town:
<select name="RT">
<option value=" "> </option>
<option value="sheriff">Sheriff</option>
<option value="invest">Investigator</option>
<option value="spy">Spy</option>
<option value="bg">Bodyguard</option>
<option value="doctor">Doctor</option>
<option value="vet">Veteran</option>
<option value="vig">Vigilante</option>
<option value="mayor">Mayor</option>
<option value="mayor">Medium</option>
<option value="ret">Retributionist</option>
<option value="trans">Transporter</option>
<option value="escort">Escort</option>
</select>
<input type="text" name="RTname">
<br>
<input type="checkbox" name="GFdead" value="dead"> Godfather:
<input type="text" name="GFname">
<br>
<input type="checkbox" name="MAFdead" value="dead"> Mafioso:
<input type="text" name="MAFname">
<br>
<input type="checkbox" name="RMdead" value="dead"> Random Mafia:
<select name="RM">
<option value=" "> </option>
<option value="framer">Framer</option>
<option value="bmer">Blackmailer</option>
<option value="consort">Consort</option>
<option value="consig">Consigliere</option>
<option value="janitor">Janitor</option>
<option value="disg">Disguiser</option>
<option value="forger">Forger</option>
</select>
<input type="text" name="RMname">
<br>
<input type="checkbox" name="RMdead" value="dead"> Random Mafia:
<select name="RM">
<option value=" "> </option>
<option value="framer">Framer</option>
<option value="bmer">Blackmailer</option>
<option value="consort">Consort</option>
<option value="consig">Consigliere</option>
<option value="janitor">Janitor</option>
<option value="disg">Disguiser</option>
<option value="forger">Forger</option>
</select>
<input type="text" name="RMname">
<br>
<input type="checkbox" name="NEdead" value="dead"> Neutral Evil:
<select name="NE">
<option value=" "> </option>
<option value="exe">Executioner</option>
<option value="witch">Witch</option>
<option value="jester">Jester</option>
</select>
<input type="text" name="NEname">
<br>
<input type="checkbox" name="NKdead" value="dead"> Neutral Killing:
<select name="NK">
<option value=" "> </option>
<option value="sk">Serial Killer</option>
<option value="ww">Werewolf</option>
<option value="arso">Arsonist</option>
</select>
<input type="text" name="NKname">
<br>
<input type="checkbox" name="guydead" value="dead"> 1:
<input type="text" name="guynotes">
<br>
<input type="checkbox" name="guydead" value="dead"> 2:
<input type="text" name="guynotes">
<br>
<input type="checkbox" name="guydead" value="dead"> 3:
<input type="text" name="guynotes">
<br>
<input type="checkbox" name="guydead" value="dead"> 4:
<input type="text" name="guynotes">
<br>
<input type="checkbox" name="guydead" value="dead"> 5:
<input type="text" name="guynotes">
<br>
<input type="checkbox" name="guydead" value="dead"> 6:
<input type="text" name="guynotes">
<br>
<input type="checkbox" name="guydead" value="dead"> 7:
<input type="text" name="guynotes">
<br>
<input type="checkbox" name="guydead" value="dead"> 8:
<input type="text" name="guynotes">
<br>
<input type="checkbox" name="guydead" value="dead"> 9 :
<input type="text" name="guynotes">
<br>
<input type="checkbox" name="guydead" value="dead"> 10:
<input type="text" name="guynotes">
<br>
<input type="checkbox" name="guydead" value="dead"> 11:
<input type="text" name="guynotes">
<br>
<input type="checkbox" name="guydead" value="dead"> 12:
<input type="text" name="guynotes">
<br>
<input type="checkbox" name="guydead" value="dead"> 13:
<input type="text" name="guynotes">
<br>
<input type="checkbox" name="guydead" value="dead"> 14:
<input type="text" name="guynotes">
<br>
<input type="checkbox" name="guydead" value="dead"> 15:
<input type="text" name="guynotes">
</form>
</body>
&#13;
答案 0 :(得分:1)
对于表单的每一行,您可以使用public class DirectorySize {
public static void main(String[] args) {
// Prompt the user to enter a directory or a file
System.out.print("Please Enter a Directory or a File: ");
Scanner input = new Scanner(System.in);
String directory = input.nextLine();
// Display the size
System.out.println(getSize(new File(directory)) + " bytes");
}
public static long getSize(File file) {
long size = 0; // Store the total size of all files
if (file.isDirectory()) {
File[] files = file.listFiles(); // All files and subdirectories
for (int i = 0; i < files.length; i++) {
size += getSize(files[i]); // Recursive call
}
}
else { // Base case
size += file.length();
}
return size;
}
包装第一个input
和select
,并为div
提供一个宽度以使您的第二个div
input
1}}正确排队。
.form-portion-1 {
display: inline-block;
width: 260px; /*modify this value to fit your form*/
}
.form-portion-1 select {
float: right;
width: 100px; /*modify this value to fit your form*/
}
<body>
<form action="/action_page.php">
<div class="form-portion-1">
<input type="checkbox" name="JAILdead" value="dead"> Jailor:
</div>
<input type="text" name="TIname">
<br>
<div class="form-portion-1">
<input type="checkbox" name="TIdead" value="dead"> Town Investigative:
<select name="TI">
<option value=" "> </option>
<option value="sheriff">Sheriff</option>
<option value="invest">Investigator</option>
<option value="spy">Spy</option>
</select>
</div>
<input type="text" name="TIname">
<br>
<div class="form-portion-1">
<input type="checkbox" name="TPdead" value="dead"> Town Protective:
<select name="TP">
<option value=" "> </option>
<option value="bg">Bodyguard</option>
<option value="doctor">Doctor</option>
</select>
</div>
<input type="text" name="TPname">
<br>
<div class="form-portion-1">
<input type="checkbox" name="TKdead" value="dead"> Town Killing:
<select name="TK">
<option value=" "> </option>
<option value="vet">Veteran</option>
<option value="vig">Vigilante</option>
</select>
</div>
<input type="text" name="TKname">
</form>
</body>
答案 1 :(得分:0)
你需要twitter bootstrap和bootstrap网格系统它将解决你所有的问题:)一个非自举解决方案是将你的数据放入带有填充的表中或创建内联块div和一致的宽度。