Reputation: 532
I am attempting to edit this code to bring the Range 1 and Code 1 texts and input fields to be all side-by-side with each other.
<td>
's width
to 20%
or 25%
doesn't do anything.align
on them doesn't move them.Setting two fields to be side by side, is OK since aligning the first one right, and the other left, would centralize both. But with four, it separates the entire row by columns, which can't align everything to what I need.
Screenshot of problem:
Table html:
<table border="0" width="80%" align="center" colspan="2">
<div align="right">
<tr><td colspan="2" align="center"><H1>Create New Sliding Scale Fee Ranges</H1></td></tr>
<tr>
<td align="center" CLASS="L1">ContractId:</td>
<td><input type="text" id="ContractId" name="ContractId" value=""/></td>
</tr>
<tr>
<td align="center" CLASS="L1">Facility:</td>
<td> <%= prodMgr.getDispenserDDLB(userId, dispenserId, "", "", "dispenserId") %></td>
</tr>
<tr><td colspan="4" align="center">
<td align="center" CLASS="L1" >1st Range:</td>
<td>
<input name="range1" value="" size="10"/>
</td>
<td align="center" CLASS="L1">Cost:</td>
<td>
<input name="cost1" value="" size="10"/>
</td>
</td>
</tr>
Upvotes: 1
Views: 1414
Reputation: 43880
Snippet
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>35490934</title>
</head>
<body>
<table border="0" width="80%" align="center" colspan="2">
<caption style="text-align:left"><H1 style="font-family: Arial; color: orange">Create New Sliding Scale Fee Ranges</H1></caption>
<thead>
<tr>
<td align="center" CLASS="L1">ContractId:</td>
<td><input type="text" id="ContractId" name="ContractId" value=""/></td>
<td align="center" CLASS="L1">Facility:</td>
<td> <input/></td>
<td colspan="4" align="center">
<td align="center" CLASS="L1" >1st Range:</td>
<td>
<input name="range1" value="" size="10"/>
</td>
<td align="center" CLASS="L1">Cost:</td>
<td>
<input name="cost1" value="" size="10"/>
</td>
</td>
</tr>
</thead>
</table>
</body>
</html>
Upvotes: 2
Reputation: 2869
Use the code below
<style>
tr{
display:inline;
float:left;
}
</style>
<H1>Create New Sliding Scale Fee Ranges</H1>
<table border="0" width="80%" align="center" colspan="2">
<div align="right">
<tr><td colspan="2" align="center"></td></tr>
<tr>
<td align="center" CLASS="L1">ContractId:</td>
<td><input type="text" id="ContractId" name="ContractId" value=""/> </td>
</tr>
<tr>
<td align="center" CLASS="L1">Facility:</td>
<td> <!--<%= prodMgr.getDispenserDDLB(userId, dispenserId, "", "", "dispenserId") %>-->
<select name="Facility" />
<option value="some text">some text</option>
</td>
</tr>
<tr><td colspan="4" align="center">
<td align="center" CLASS="L1" >1st Range:</td>
<td>
<input name="range1" value="" size="10"/>
</td>
<td align="center" CLASS="L1">Cost:</td>
<td>
<input name="cost1" value="" size="10"/>
</td>
</td>
</tr>
</table>
Upvotes: 1