How to prevent the table cells from expanding the margins HTML - html

I would like to make a table in html. It is supposed to display two rows and three columns. For some reason, currently the margins of the table cells keep expanding.
The first cell has a small margin, the second cell has bigger margins, the third cell's margins are even bigger, and so on. It keeps getting bigger and bigger.
I have attached a screenshot that shows how it currently looks:
Table with expanding margins
Here is my HTML & CSS code respectively:
html {
text-align: center;
}
body {
background-color: antiquewhite;
width: 50%;
margin-right: auto;
margin-left: auto;
margin-top: 10px;
}
table,
td {
margin-right: auto;
margin-left: auto;
table-layout: fixed;
}
<table>
<tr>
<td colspan="6">
<h1>Voici la liste de modules</h1>
</td>
</tr>
<tr>
<td colspan="2">
<button class="bouton_module" onlcick="window.location.href='m01/module1.html';">Module 1</button>
</td>
<td colspawn="2">
<button class="bouton_module" onclick="window.locaiton.href='m02/module2.html';">Module 2</button>
</td>
<td colspan="2">
<button class="bouton_module" onclick="window.location.href='m03/module3.html';">Module 3</button>
</td>
</tr>
<tr>
<td colspan="2">
<button class="bouton_module" onclick="window.location.href='m04/module4.html';">Module 4</button>
</td>
<td colspan="2">
<button class="bouton_module">Module 5</button>
</td>
<td colspan="2">
<button class="bouton_module">Module 6</button>
</td>
</tr>
</table>

You were mishandling the colspan and rowspan of cells, plus a misspelled ("colspaWn"). I just removed that and inserted the td {text-align: center;} rule. Note that you can enter td { outline: 1px solid red; } to see its lines without affecting the width.
html {
text-align: center;
}
body {
background-color: antiquewhite;
width: 50%;
margin-right: auto;
margin-left: auto;
margin-top: 10px;
}
table, td {
/* outline: 1px solid red; */
text-align: center;
margin-right: auto;
margin-left: auto;
table-layout: fixed;
}
<table>
<tr>
<td colspan="6">
<h1>Voici la liste de modules</h1>
</td>
</tr>
<tr>
<td>
<button class="bouton_module" onlcick="window.location.href='m01/module1.html';">Module 1</button>
</td>
<td>
<button class="bouton_module" onclick="window.locaiton.href='m02/module2.html';">Module 2</button>
</td>
<td>
<button class="bouton_module" onclick="window.location.href='m03/module3.html';">Module 3</button>
</td>
</tr>
<tr>
<td>
<button class="bouton_module" onclick="window.location.href='m04/module4.html';">Module 4</button>
</td>
<td>
<button class="bouton_module">Module 5</button>
</td>
<td>
<button class="bouton_module">Module 6</button>
</td>
</tr>
</table>

Related

Can't centre a table within a div in HTML and CSS - responsive website

I'm trying to center an HTML table in CSS but the code is not working. I have tried justify-content, align-content, margins, etc but can't seem to get anything to work. The website needs to be responsive so all values need to be percentages (which makes it a bit harder). Additionally, for some reason, some of the columns are different widths to the last one?? Not sure about that either. I'll put the code below.
.numberButton {
background-color: #707070;
width: 100%;
height: 35%;
text-align: center;
}
.tdNumber {
width: 30%;
height: 40%;
}
#numberTable {
align-content: center;
justify-content: center;
padding: 20px;
text-align: center;
margin: 0 auto;
width: 90%;
}
#numberBackground {
background-color: #3968CB;
margin: 0px;
width: auto;
height: 400%;
justify-content: center;
}
<body id="numberBackground">
<div id="numberTable">
<table>
<tbody>
<tr>
<td class="tdNumber"><button id="one" class="numberButton">1</button></td>
<td class="tdNumber"><button id="two" class="numberButton">2</button></td>
<td class="tdNumber"><button id="three" class="numberButton">3</button></td>
<td class="tdNumber"><button id="four" class="numberButton">4</button></td>
</tr>
<tr>
<td class="tdNumber"><button id="five" class="numberButton">5</button></td>
<td class="tdNumber"><button id="six" class="numberButton">6</button></td>
<td class="tdNumber"><button id="seven" class="numberButton">7</button></td>
<td class="tdNumber"><button id="eight" class="numberButton">8</button></td>
</tr>
<tr>
<td class="tdNumber"><button id="nine" class="numberButton">9</button></td>
<td class="tdNumber"><button id="ten" class="numberButton">10</button></td>
<td class="tdNumber"><button id="eleven" class="numberButton">11</button></td>
<td class="tdNumber"><button id="twelve" class="numberButton">12</button></td>
</tr>
<tr>
<td class="tdNumber"><button id="thirteen" class="numberButton">13</button></td>
<td class="tdNumber"><button id="fourteen" class="numberButton">14</button></td>
<td class="tdNumber"><button id="fifteen" class="numberButton">15</button></td>
<td class="tdNumber"><button id="sixteen" class="numberButton">16</button></td>
</tr>
<tr>
<td class="tdNumber"><button id="seventeen" class="numberButton">17</button></td>
<td class="tdNumber"><button id="eighteen" class="numberButton">18</button></td>
<td class="tdNumber"><button id="nineteen" class="numberButton">19</button></td>
<td class="tdNumber"><button id="twenty" class="numberButton">20</button></td>
</tr>
<tr>
<td><button onclick="location.href='Topics Page.html'" type="button" id="backanimal" class="numberButton">BACK</button></td>
<td><button onclick="location.href='Numbers_Test.html'" type="button" id="testanimal" class="numberButton">TEST</button></td>
</tr>
</tbody>
</table>
</div>
Hi if you want Use align-items: center; and justify-content: center; first must use display: flex and ..., I fix your code but you must more organize that.
#numberTable {
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
text-align: center;
margin: 0 auto;
}
.tdNumber{
height: auto;
padding: .2rem;
}
just add below mentioned CSS codes in your numberBackground tag, your problem will be solved. For inside box elements sizes you can use flex-child properties.
#numberBackground {
background-color: #3968CB;
margin: 0px;
width: auto;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
/* justify-content: center; */
}
Add position absolute to your table. Then use transform to position it at center.
.numberButton {
background-color: #707070;
width: 100%;
height: 35%;
text-align: center;
}
.tdNumber {
width: 30%;
height: 40%;
}
#numberTable {
align-content: center;
justify-content: center;
padding: 20px;
text-align: center;
margin: 0 auto;
width: 90%;
}
table {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
#numberBackground {
background-color: #3968CB;
margin: 0px;
width: auto;
height: 400%;
justify-content: center;
}
<div id="numberTable">
<table>
<tbody>
<tr>
<td class="tdNumber"><button id="one" class="numberButton">1</button></td>
<td class="tdNumber"><button id="two" class="numberButton">2</button></td>
<td class="tdNumber"><button id="three" class="numberButton">3</button></td>
<td class="tdNumber"><button id="four" class="numberButton">4</button></td>
</tr>
<tr>
<td class="tdNumber"><button id="five" class="numberButton">5</button></td>
<td class="tdNumber"><button id="six" class="numberButton">6</button></td>
<td class="tdNumber"><button id="seven" class="numberButton">7</button></td>
<td class="tdNumber"><button id="eight" class="numberButton">8</button></td>
</tr>
<tr>
<td class="tdNumber"><button id="nine" class="numberButton">9</button></td>
<td class="tdNumber"><button id="ten" class="numberButton">10</button></td>
<td class="tdNumber"><button id="eleven" class="numberButton">11</button></td>
<td class="tdNumber"><button id="twelve" class="numberButton">12</button></td>
</tr>
<tr>
<td class="tdNumber"><button id="thirteen" class="numberButton">13</button></td>
<td class="tdNumber"><button id="fourteen" class="numberButton">14</button></td>
<td class="tdNumber"><button id="fifteen" class="numberButton">15</button></td>
<td class="tdNumber"><button id="sixteen" class="numberButton">16</button></td>
</tr>
<tr>
<td class="tdNumber"><button id="seventeen" class="numberButton">17</button></td>
<td class="tdNumber"><button id="eighteen" class="numberButton">18</button></td>
<td class="tdNumber"><button id="nineteen" class="numberButton">19</button></td>
<td class="tdNumber"><button id="twenty" class="numberButton">20</button></td>
</tr>
<tr>
<td><button onclick="location.href='Topics Page.html'" type="button" id="backanimal" class="numberButton">BACK</button></td>
<td><button onclick="location.href='Numbers_Test.html'" type="button" id="testanimal" class="numberButton">TEST</button></td>
</tr>
</tbody>
</table>
</div>

1px border issue not displaying

I'm trying to highlight a specific product on the comparison table. The highlight color is Red but i'm having issues when using 1px, but when i use 2px it works fine but 2px is to big.
Also noticed on this code snippet it does not display RED borders after i have added bootstrap, so attaching a screenshot.
My goal is to have Selected Product to be surrounded by RED 1px border. Also i would not mind any other tips of displaying these types of table.
I have also tried this but did not work: https://muffinman.io/fix-for-chrome-not-rendering-borders/
Also looks like this is not Bootstrap issue, if i remove the BS and use border-collapse: collapse; same problem
.table {
margin: 20px;
display: inline-block;
text-align: center;
}
table,
th,
td {
border: 1px solid #ddd;
padding: 10px;
}
th:not(:first-child) {
width: 200px;
}
table,
th {
font-weight: normal;
}
.border-sides {
border-right: 1px solid red !important;
border-left: 1px solid red !important;
}
.border-top {
border-top: 1px solid red !important;
}
.border-bottom {
border-bottom: 1px solid red !important;
}
.bg-selected {
background-color: #b3c2ff;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"/>
<div class="table">
<table>
<thead>
<tr>
<th></th>
<th>
<div class="text-left">
<span>Title - Product 1 Test</span>
</div>
</th>
<th class="border border-top">
<div class="text-left">
<span class="font-weight-bold">Selected Product:</span>
<span>Title - Product 2</span>
</div>
</th>
<th>
<div class="text-left">
<span>Title - Product 2</span>
</div>
</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td>
<button class="btn btn-primary">View</button>
</td>
<td class="border border-sides">
<button class="btn btn-primary">Buy now</button>
</td>
<td>
<button class="btn btn-primary">View</button>
</td>
</tr>
<tr class="text-left">
<td>Description 1</td>
<td>Y</td>
<td class="border bg-selected">N</td>
<td>N</td>
</tr>
<tr class="text-left">
<td class="test">Description 2</td>
<td>N</td>
<td class="border bg-selected">N</td>
<td>N</td>
</tr>
<tr>
<td></td>
<td>
<button class="btn btn-primary">View</button>
</td>
<td class="border border-bottom">
<button class="btn btn-primary">Buy now</button>
</td>
<td>
<button class="btn btn-primary">View</button>
</td>
</tr>
</tbody>
</table>
</div>
Also double checked my BS is running first then my CSS or i'm missing something?
Is this the desired ouput?
UPDATED
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet" />
<style>
.table {
margin: 20px;
display: inline-block;
text-align: center;
}
table,
.table thead th,
.table td {
border: 1px solid #ddd;
border-collapse: separate;
border-spacing: 0px;
padding: 10px;
}
table {
padding: 0;
border-width: 0 2px 0 0.5px;
}
th:not(:first-child) {
width: 200px;
}
table,
th {
font-weight: normal;
}
.table thead th{
border-top-width: 1px;
}
.table tr:last-child td{
border-bottom-width: 1px;
}
.table thead th, .table td{
border-right: none;
}
.border-sides {
border-right: 1px solid red !important;
border-left: 1px solid red !important;
}
.border-sides + td, .table thead .border-sides + th{
border-left: none;
}
.border-top {
border-top: 1px solid red !important;
}
.border-bottom {
border-bottom: 1px solid red !important;
}
.bg-selected {
background-color: #b3c2ff;
}
</style>
<div class="table">
<table>
<thead>
<tr>
<th></th>
<th>
<div class="text-left">
<span>Title - Product 1 Test</span>
</div>
</th>
<th class="border border-top border-sides">
<div class="text-left">
<span class="font-weight-bold">Selected Product:</span>
<span>Title - Product 2</span>
</div>
</th>
<th>
<div class="text-left">
<span>Title - Product 2</span>
</div>
</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td>
<button class="btn btn-primary">View</button>
</td>
<td class="border border-sides">
<button class="btn btn-primary">Buy now</button>
</td>
<td>
<button class="btn btn-primary">View</button>
</td>
</tr>
<tr class="text-left">
<td>Description 1</td>
<td>Y</td>
<td class="border bg-selected border-sides">N</td>
<td>N</td>
</tr>
<tr class="text-left">
<td class="test">Description 2</td>
<td>N</td>
<td class="border border-sides bg-selected">N</td>
<td>N</td>
</tr>
<tr>
<td></td>
<td>
<button class="btn btn-primary">View</button>
</td>
<td class="border border-bottom border-sides">
<button class="btn btn-primary">Buy now</button>
</td>
<td>
<button class="btn btn-primary">View</button>
</td>
</tr>
</tbody>
</table>
</div>
You can add td for your rule, for example td.border-top then it makes it more specific then the BS rule and overrides it

How do I make td occupy 50% of tr

I have the following snippet. It has one problem - the Enter your passcode: td occupies too much space, and looks ugly.
I've tried to set width:50% to that, but it didn't work out.
What I'm trying to achieve is that the input field goes line in line to the Expertise Organization button.
How can I do that?
Thanks in advance.
.prettyEGRZButton {
width: 100%;
padding: 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
border-radius: 12px;
border: 1px solid #05788d;
color: #05788d;
background: transparent;
}
.prettyEGRZButtonActive {
color: white;
background: #05788d;
}
<div id="view:_id1:egrzFinishAuthPopUp" class="egrzFinishAuthPopUp">
<div id="view:_id1:organizationsRepeat">
</div>
<div id="view:_id1:rolesRepeat">
</div>
<table id="view:_id1:egrzFinishAuthPopUpTable" role="presentation">
<tbody>
<tr align="center">
<td>
<span class="xspTextLabel">To proceed, please authorize</span>
</td>
</tr>
<tr align="center">
<td>
<span class="xspTextLabel">Authorize as natural person</span>
</td>
</tr>
<tr id="view:_id1:authAsPersonTr">
<td id="view:_id1:authAsPersonTd">
<button class="prettyEGRZButton" type="button" name="view:_id1:authAsPersonButton" id="view:_id1:authAsPersonButton">John Doe</button>
</td>
</tr>
<tr align="center">
<td>
<span class="xspTextLabel">Authorize as organization</span>
</td>
</tr>
<tr id="view:_id1:organizationsRepeat:0:authAsOrgTr">
<td id="view:_id1:organizationsRepeat:0:authAsOrgTd">
<button class="prettyEGRZButton" type="button" name="view:_id1:organizationsRepeat:0:authAsOrgButton" id="view:_id1:organizationsRepeat:0:authAsOrgButton">Company 1</button>
</td>
</tr>
<tr id="view:_id1:organizationsRepeat:1:authAsOrgTr">
<td id="view:_id1:organizationsRepeat:1:authAsOrgTd">
<button class="prettyEGRZButton prettyEGRZButtonActive" type="button" name="view:_id1:organizationsRepeat:1:authAsOrgButton" id="view:_id1:organizationsRepeat:1:authAsOrgButton">Company 2</button>
</td>
</tr>
<tr id="view:_id1:rolesRepeat:0:roleTr">
<td id="view:_id1:rolesRepeat:0:roleTd">
<button class="prettyEGRZButton" type="button" name="view:_id1:rolesRepeat:0:roleButton" id="view:_id1:rolesRepeat:0:roleButton">Government Organization</button>
</td>
</tr>
<tr id="view:_id1:rolesRepeat:1:roleTr">
<td id="view:_id1:rolesRepeat:1:roleTd">
<button class="prettyEGRZButton" type="button" name="view:_id1:rolesRepeat:1:roleButton" id="view:_id1:rolesRepeat:1:roleButton">Expertise Organization</button>
</td>
</tr>
<tr>
<td>
<span class="xspTextComputedField">Enter your passcode:</span>
</td>
<td>
<input id="view:_id1:inputText1" type="password" name="view:_id1:inputText1" value="" class="xspInputFieldSecret">
</td>
</tr>
</tbody>
</table>
</div>
Your first couple tr are one td only. So the bottom tr need to honor it. You can use two rows to make it align.
.prettyEGRZButton
{
width: 100%;
padding: 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
border-radius: 12px;
border: 1px solid #05788d;
color: #05788d;
background: transparent;
}
.prettyEGRZButtonActive
{
color: white;
background: #05788d;
}
.xspInputFieldSecret{
width:100%;
}
<div id="view:_id1:egrzFinishAuthPopUp" class="egrzFinishAuthPopUp"><div id="view:_id1:organizationsRepeat">
</div><div id="view:_id1:rolesRepeat">
</div><table id="view:_id1:egrzFinishAuthPopUpTable" role="presentation"><tbody><tr align="center"><td><span class="xspTextLabel">To proceed, please authorize</span></td>
</tr>
<tr align="center"><td><span class="xspTextLabel">Authorize as natural person</span></td>
</tr>
<tr id="view:_id1:authAsPersonTr"><td id="view:_id1:authAsPersonTd"><button class="prettyEGRZButton" type="button" name="view:_id1:authAsPersonButton" id="view:_id1:authAsPersonButton">John Doe</button></td>
</tr>
<tr align="center"><td><span class="xspTextLabel">Authorize as organization</span></td>
</tr>
<tr id="view:_id1:organizationsRepeat:0:authAsOrgTr"><td id="view:_id1:organizationsRepeat:0:authAsOrgTd"><button class="prettyEGRZButton" type="button" name="view:_id1:organizationsRepeat:0:authAsOrgButton" id="view:_id1:organizationsRepeat:0:authAsOrgButton">Company 1</button></td>
</tr>
<tr id="view:_id1:organizationsRepeat:1:authAsOrgTr"><td id="view:_id1:organizationsRepeat:1:authAsOrgTd"><button class="prettyEGRZButton prettyEGRZButtonActive" type="button" name="view:_id1:organizationsRepeat:1:authAsOrgButton" id="view:_id1:organizationsRepeat:1:authAsOrgButton">Company 2</button></td>
</tr>
<tr id="view:_id1:rolesRepeat:0:roleTr"><td id="view:_id1:rolesRepeat:0:roleTd"><button class="prettyEGRZButton" type="button" name="view:_id1:rolesRepeat:0:roleButton" id="view:_id1:rolesRepeat:0:roleButton">Government Organization</button></td>
</tr>
<tr id="view:_id1:rolesRepeat:1:roleTr"><td id="view:_id1:rolesRepeat:1:roleTd"><button class="prettyEGRZButton" type="button" name="view:_id1:rolesRepeat:1:roleButton" id="view:_id1:rolesRepeat:1:roleButton">Expertise Organization</button></td>
</tr>
<tr><td><span class="xspTextComputedField">Enter your passcode:</span></td>
</tr><tr>
<td><input id="view:_id1:inputText1" type="password" name="view:_id1:inputText1" value="" class="xspInputFieldSecret"></td>
</tr>
</tbody></table>
</div>

How to remove html table data padding

I read applied the suggested CSS here answers to this problem. But it doesn't help me.
How can I remove this padding?
Also how to add space?
HTML and CSS gives me this output:-
#page {
border: 0px;
border-collapse: collapse;
border-spacing: 0px;
}
#page td {
padding: 0;
margin: 0;
}
Hello world <br/>
<table id="page">
<tr>
<td align="left"><input type='button' value='button1'></td>
<td align="left"><input type='button' value='button2'></td>
<td align="left"><input type='button' value='button3'></td>
<td align="left"><input type='button' value='button4'></td>
</tr>
<tr>
<td align="left"><input type='button' value='Sort Name A-Z'></td>
<td align="left"><input type='button' value='Save sorting'></td>
</tr>
</table>
To make the buttons the same size, force them to occupy a specific width (in my example, 98% of the available width)
to create "padding" make them smaller then the full available width and center them (please note the css vertical-align is the recommended way to align a td over the deprecated align attribute
#page {
border: 0px;
border-collapse: collapse;
border-spacing: 0px;
}
#page td {
padding: 0;
margin: 0;
vertical-align: center
}
input[type="button"] {
width: 98%;
}
Hello world <br/>
<table id="page">
<tr>
<td align="left"><input type='button' value='button1'></td>
<td align="left"><input type='button' value='button2'></td>
<td align="left"><input type='button' value='button3'></td>
<td align="left"><input type='button' value='button4'></td>
</tr>
<tr>
<td align="left"><input type='button' value='Sort Name A-Z'></td>
<td align="left"><input type='button' value='Save sorting'></td>
</tr>
</table>
There are so many ways to do that. Here is an example. First I decide the size of the table, then I make the inputs width:100% and finally I add a margin-left.
#page {
border:0px;
border-spacing:0px;
}
#page td {
padding: 0;
margin: 0;
}
/*Makes all the inputs 100% width and add a margin*/
input {
width: calc(100% - 20px);
margin-right: 20px;
}
/*Define a size for the table*/
table {
width: 600px;
}
<html>
<header><title>This is title</title></header>
<body>
Hello world <br/>
<table id="page" >
<tr>
<td align="left"><input type='button' value='button1' ></td>
<td align="left"><input type='button' value='button2' ></td>
<td align="left"><input type='button' value='button3' ></td>
<td align="left"><input type='button' value='button4' ></td>
</tr>
<tr>
<td align="left"><input type='button' value='Sort Name A-Z'></td>
<td align="left"><input type='button' value='Save sorting' ></td>
</tr>
</table>
</body>

Float Layout with fixed width and one expanding element

I would like to do something like this:
Prefix - Input(Type: Text, Number,..) - Suffix - Button
ul
{
list-style: none;
width: 300px;
margin: 0;
padding: 0;
}
li
{
margin: 0;
padding: 0;
}
table
{
margin: 0 auto;
padding: 0;
border-spacing: 0px;
border-collapse: collapse;
}
input[type=number]
{
width: 100%;
}
input[type=button]
{
width: 100%;
padding: 0px 20px;
}
.value
{
padding-right: 10px;
padding-left: 10px;
}
.ok
{
padding-left: 10px;
}
<ul>
<li>
<table>
<tr>
<td class="prefix">
prefix
</td>
<td class="value">
<input type="number" size="1"/>
</td>
<td class="sufix">
suffix
</td>
<td class="ok">
<input type="button" value="val1"/>
</td>
</tr>
</table>
</li>
<li>
<table>
<tr>
<td class="prefix">
pre
</td>
<td class="value">
<input type="number" size="1"/>
</td>
<td class="sufix">
suf
</td>
<td class="ok">
<input type="button" value="longervalue"/>
</td>
</tr>
</table>
</li>
<li>
<table>
<tr>
<td class="prefix">
pre
</td>
<td class="value">
<input type="number" size="1"/>
</td>
<td class="sufix">
suf
</td>
<td class="ok">
<input type="button" value="v"/>
</td>
</tr>
</table>
</li>
</ul>
I have a fixed width within this 4 things have to be placed.
I don't know the Prefix, Suffix and also not the Text of the Button.
I would like that all those 3 elements use the minimal possible space and the width of the inputtag fills up this place.
Is this possible?
I would not like to use a table or JS IF POSSIBLE
Use Flexbox layout.
Given this html:
<section>
<label>pre</label>
<input type="number" size="1"/>
<label>suf</label>
<input type="button" value="longervalue"/>
</section>
All you need is:
section {
display: flex;
}
input[type=number] {
flex-grow: 1;
}
jsFiddle
Use belo code
<style>
ul
{
list-style: none;
width: 300px;
margin: 0;
padding: 0;
}
li
{
margin: 0;
padding: 0;
}
table
{
margin: 0 auto;
padding: 0;
border-spacing: 0px;
border-collapse: collapse;
}
input[type=number]
{
width: 100%;
}
input[type=button]
{
width: 100%;
padding: 0px 20px;
}
.value
{
padding-right: 10px;
padding-left: 10px;
}
.ok
{
padding-left: 10px;
}
</style>
<ul>
<li>
<table>
<tr>
<td class="prefix">
prefix
</td>
<td class="value">
<input type="number" size="1"/>
</td>
<td class="sufix">
suffix
</td>
<td class="ok">
<input type="button" value="val1"/>
</td>
</tr>
<tr>
<td class="prefix">
pre
</td>
<td class="value">
<input type="number" size="1"/>
</td>
<td class="sufix">
suf
</td>
<td class="ok">
<input type="button" value="longervalue"/>
</td>
</tr>
<tr>
<td class="prefix">
pre
</td>
<td class="value">
<input type="number" size="1"/>
</td>
<td class="sufix">
suf
</td>
<td class="ok">
<input type="button" value="v"/>
</td>
</tr>
</table>
</li>