L
L
Larisa2017-05-01 18:34:31
C++ / C#
Larisa, 2017-05-01 18:34:31

How to stretch input with table-cell?

What is needed
f0f6ff2022.jpg

<div class="group">
        <input type="text" class="control">
        <span class="addon">@</span>
</div>

.group {
       width: 100%;
       display: table;
       table-layout: fixed;}
.addon,
.control {
        display: table-cell;
        padding: 10px; }
.control {
        background-color: #eee;
        border: 1px solid red;}
.addon {
         width:30px;
         background-color: #cccccc;}

Can't stretch input without wrapping it in an extra div (
Can anyone suggest a solution without wrapping the input in an extra div?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
alexalexes, 2018-06-08
@Nerwin

You are trying to mix the logic of storing a list of topics with the logic of displaying them.
// add menu item here
and
public void click(object sender, EventArgs e)
{
// procedure for changing textbox1.text here
}
It shouldn't be in this class.
Form filling should occur in the form class using ready-made objects of the Lesson class.

A
Artur Karapetyan, 2017-05-01
@architawr

Have you tried just doing

.control {
        background-color: #eee;
        width: 100%;
        border: 1px solid red;}

A
Andrey Fedorov, 2017-05-01
@aliencash

Use calc() to calculate the input width. Just don't forget the border and padding to take into account.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question